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 #include "base/at_exit.h" | 6 #include "base/at_exit.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 SYSTEMTIME local_time; | 54 SYSTEMTIME local_time; |
55 ::GetSystemTime(&local_time); | 55 ::GetSystemTime(&local_time); |
56 std::string hex(HexEncode(&local_time, sizeof(local_time))); | 56 std::string hex(HexEncode(&local_time, sizeof(local_time))); |
57 base::StringPiece sp_hex(hex); | 57 base::StringPiece sp_hex(hex); |
58 hr = registrar->AddReplacement(L"SYSTIME", | 58 hr = registrar->AddReplacement(L"SYSTIME", |
59 base::SysNativeMBToWide(sp_hex).c_str()); | 59 base::SysNativeMBToWide(sp_hex).c_str()); |
60 DCHECK(SUCCEEDED(hr)); | 60 DCHECK(SUCCEEDED(hr)); |
61 } | 61 } |
62 | 62 |
63 if (SUCCEEDED(hr)) { | 63 if (SUCCEEDED(hr)) { |
64 std::wstring app_path( | 64 FilePath app_path = |
65 chrome_launcher::GetChromeExecutablePath()); | 65 chrome_launcher::GetChromeExecutablePath().DirName(); |
66 app_path = file_util::GetDirectoryFromPath(app_path); | 66 hr = registrar->AddReplacement(L"CHROME_APPPATH", |
67 hr = registrar->AddReplacement(L"CHROME_APPPATH", app_path.c_str()); | 67 app_path.value().c_str()); |
68 DCHECK(SUCCEEDED(hr)); | 68 DCHECK(SUCCEEDED(hr)); |
69 } | 69 } |
70 | 70 |
71 if (SUCCEEDED(hr)) { | 71 if (SUCCEEDED(hr)) { |
72 hr = registrar->AddReplacement(L"CHROME_APPNAME", | 72 hr = registrar->AddReplacement(L"CHROME_APPNAME", |
73 chrome::kBrowserProcessExecutableName); | 73 chrome::kBrowserProcessExecutableName); |
74 DCHECK(SUCCEEDED(hr)); | 74 DCHECK(SUCCEEDED(hr)); |
75 | 75 |
76 // Fill in VERSION from the VERSIONINFO stored in the DLL's resources. | 76 // Fill in VERSION from the VERSIONINFO stored in the DLL's resources. |
77 scoped_ptr<FileVersionInfo> module_version_info( | 77 scoped_ptr<FileVersionInfo> module_version_info( |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 sd.GetDacl(&new_dacl); | 486 sd.GetDacl(&new_dacl); |
487 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); | 487 new_dacl.AddAllowedAce(token_.GetUser(), GENERIC_WRITE | GENERIC_READ); |
488 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { | 488 if (AtlSetDacl(object_name.c_str(), SE_REGISTRY_KEY, new_dacl)) { |
489 result = SetOrDeleteMimeHandlerKey(enable); | 489 result = SetOrDeleteMimeHandlerKey(enable); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 backup.RestoreSecurity(object_name.c_str()); | 493 backup.RestoreSecurity(object_name.c_str()); |
494 return result; | 494 return result; |
495 } | 495 } |
OLD | NEW |