OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/lock.h" | 16 #include "base/lock.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/logging_win.h" | 18 #include "base/logging_win.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/registry.h" | |
21 #include "base/string_number_conversions.h" | 20 #include "base/string_number_conversions.h" |
22 #include "base/string_piece.h" | 21 #include "base/string_piece.h" |
23 #include "base/string_util.h" | 22 #include "base/string_util.h" |
24 #include "base/sys_string_conversions.h" | 23 #include "base/sys_string_conversions.h" |
| 24 #include "base/win/registry.h" |
25 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/installer/util/google_update_settings.h" | 28 #include "chrome/installer/util/google_update_settings.h" |
29 #include "grit/chrome_frame_resources.h" | 29 #include "grit/chrome_frame_resources.h" |
30 #include "chrome_frame/bho.h" | 30 #include "chrome_frame/bho.h" |
31 #include "chrome_frame/chrome_active_document.h" | 31 #include "chrome_frame/chrome_active_document.h" |
32 #include "chrome_frame/chrome_frame_activex.h" | 32 #include "chrome_frame/chrome_frame_activex.h" |
33 #include "chrome_frame/chrome_frame_automation.h" | 33 #include "chrome_frame/chrome_frame_automation.h" |
34 #include "chrome_frame/exception_barrier.h" | 34 #include "chrome_frame/exception_barrier.h" |
35 #include "chrome_frame/chrome_frame_reporting.h" | 35 #include "chrome_frame/chrome_frame_reporting.h" |
36 #include "chrome_frame/chrome_launcher_utils.h" | 36 #include "chrome_frame/chrome_launcher_utils.h" |
37 #include "chrome_frame/chrome_protocol.h" | 37 #include "chrome_frame/chrome_protocol.h" |
38 #include "chrome_frame/module_utils.h" | 38 #include "chrome_frame/module_utils.h" |
39 #include "chrome_frame/resource.h" | 39 #include "chrome_frame/resource.h" |
40 #include "chrome_frame/utils.h" | 40 #include "chrome_frame/utils.h" |
41 #include "googleurl/src/url_util.h" | 41 #include "googleurl/src/url_util.h" |
42 | 42 |
| 43 using base::win::RegKey; |
| 44 |
43 namespace { | 45 namespace { |
44 // This function has the side effect of initializing an unprotected | 46 // This function has the side effect of initializing an unprotected |
45 // vector pointer inside GoogleUrl. If this is called during DLL loading, | 47 // vector pointer inside GoogleUrl. If this is called during DLL loading, |
46 // it has the effect of avoiding an initialization race on that pointer. | 48 // it has the effect of avoiding an initialization race on that pointer. |
47 // TODO(siggi): fix GoogleUrl. | 49 // TODO(siggi): fix GoogleUrl. |
48 void InitGoogleUrl() { | 50 void InitGoogleUrl() { |
49 static const char kDummyUrl[] = "http://www.google.com"; | 51 static const char kDummyUrl[] = "http://www.google.com"; |
50 | 52 |
51 url_util::IsStandard(kDummyUrl, | 53 url_util::IsStandard(kDummyUrl, |
52 url_parse::MakeRange(0, arraysize(kDummyUrl))); | 54 url_parse::MakeRange(0, arraysize(kDummyUrl))); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 sd.GetDacl(&new_dacl); | 736 sd.GetDacl(&new_dacl); |
735 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); | 737 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); |
736 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { | 738 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { |
737 result = SetOrDeleteMimeHandlerKey(enable, HKEY_LOCAL_MACHINE); | 739 result = SetOrDeleteMimeHandlerKey(enable, HKEY_LOCAL_MACHINE); |
738 } | 740 } |
739 } | 741 } |
740 | 742 |
741 backup.RestoreSecurity(object_name.c_str()); | 743 backup.RestoreSecurity(object_name.c_str()); |
742 return result; | 744 return result; |
743 } | 745 } |
OLD | NEW |