OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // chrome_tab.cc : Implementation of DLL Exports. | 5 // chrome_tab.cc : Implementation of DLL Exports. |
6 | 6 |
7 // Include without path to make GYP build see it. | 7 // Include without path to make GYP build see it. |
8 #include "chrome_tab.h" // NOLINT | 8 #include "chrome_tab.h" // NOLINT |
9 | 9 |
10 #include <atlsecurity.h> | 10 #include <atlsecurity.h> |
11 | 11 |
12 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/file_version_info.h" | 15 #include "base/file_version_info.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/logging_win.h" | 17 #include "base/logging_win.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/registry.h" | 19 #include "base/registry.h" |
20 #include "base/string_piece.h" | 20 #include "base/string_piece.h" |
21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
22 #include "base/sys_string_conversions.h" | 22 #include "base/sys_string_conversions.h" |
23 #include "base/win_util.h" | 23 #include "base/win_util.h" |
24 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
25 #include "grit/chrome_frame_resources.h" | 25 #include "grit/chrome_frame_resources.h" |
26 #include "chrome_frame/bho.h" | 26 #include "chrome_frame/bho.h" |
| 27 #include "chrome_frame/chrome_active_document.h" |
| 28 #include "chrome_frame/chrome_frame_activex.h" |
27 #include "chrome_frame/chrome_frame_automation.h" | 29 #include "chrome_frame/chrome_frame_automation.h" |
28 #include "chrome_frame/chrome_frame_reporting.h" | 30 #include "chrome_frame/chrome_frame_reporting.h" |
29 #include "chrome_frame/chrome_launcher.h" | 31 #include "chrome_frame/chrome_launcher.h" |
| 32 #include "chrome_frame/chrome_protocol.h" |
30 #include "chrome_frame/resource.h" | 33 #include "chrome_frame/resource.h" |
31 #include "chrome_frame/utils.h" | 34 #include "chrome_frame/utils.h" |
32 | 35 |
33 static const wchar_t kBhoRegistryPath[] = | 36 static const wchar_t kBhoRegistryPath[] = |
34 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" | 37 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" |
35 L"\\Browser Helper Objects"; | 38 L"\\Browser Helper Objects"; |
36 | 39 |
37 const wchar_t kInternetSettings[] = | 40 const wchar_t kInternetSettings[] = |
38 L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; | 41 L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; |
39 | 42 |
40 const wchar_t kBhoNoLoadExplorerValue[] = L"NoExplorer"; | 43 const wchar_t kBhoNoLoadExplorerValue[] = L"NoExplorer"; |
41 | 44 |
42 // {0562BFC3-2550-45b4-BD8E-A310583D3A6F} | 45 // {0562BFC3-2550-45b4-BD8E-A310583D3A6F} |
43 static const GUID kChromeFrameProvider = | 46 static const GUID kChromeFrameProvider = |
44 { 0x562bfc3, 0x2550, 0x45b4, | 47 { 0x562bfc3, 0x2550, 0x45b4, |
45 { 0xbd, 0x8e, 0xa3, 0x10, 0x58, 0x3d, 0x3a, 0x6f } }; | 48 { 0xbd, 0x8e, 0xa3, 0x10, 0x58, 0x3d, 0x3a, 0x6f } }; |
46 | 49 |
| 50 // Object entries go here instead of with each object, so that we can move |
| 51 // the objects to a lib. Also reduces magic. |
| 52 OBJECT_ENTRY_AUTO(CLSID_ChromeFrameBHO, Bho) |
| 53 OBJECT_ENTRY_AUTO(__uuidof(ChromeActiveDocument), ChromeActiveDocument) |
| 54 OBJECT_ENTRY_AUTO(__uuidof(ChromeFrame), ChromeFrameActivex) |
| 55 OBJECT_ENTRY_AUTO(__uuidof(ChromeProtocol), ChromeProtocol) |
47 | 56 |
48 class ChromeTabModule | 57 class ChromeTabModule |
49 : public AtlPerUserModule<CAtlDllModuleT<ChromeTabModule> > { | 58 : public AtlPerUserModule<CAtlDllModuleT<ChromeTabModule> > { |
50 public: | 59 public: |
51 typedef AtlPerUserModule<CAtlDllModuleT<ChromeTabModule> > ParentClass; | 60 typedef AtlPerUserModule<CAtlDllModuleT<ChromeTabModule> > ParentClass; |
52 | 61 |
53 DECLARE_LIBID(LIBID_ChromeTabLib) | 62 DECLARE_LIBID(LIBID_ChromeTabLib) |
54 DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CHROMETAB, | 63 DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CHROMETAB, |
55 "{FD9B1B31-F4D8-436A-8F4F-D3C2E36733D3}") | 64 "{FD9B1B31-F4D8-436A-8F4F-D3C2E36733D3}") |
56 | 65 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 sd.GetDacl(&new_dacl); | 521 sd.GetDacl(&new_dacl); |
513 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); | 522 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); |
514 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { | 523 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { |
515 result = SetOrDeleteMimeHandlerKey(enable); | 524 result = SetOrDeleteMimeHandlerKey(enable); |
516 } | 525 } |
517 } | 526 } |
518 | 527 |
519 backup.RestoreSecurity(object_name.c_str()); | 528 backup.RestoreSecurity(object_name.c_str()); |
520 return result; | 529 return result; |
521 } | 530 } |
OLD | NEW |