| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Need to include this before the ATL headers below. | 7 // Need to include this before the ATL headers below. |
| 8 #include "chrome_frame/chrome_tab.h" | 8 #include "chrome_frame/chrome_tab.h" |
| 9 | 9 |
| 10 #include <atlsecurity.h> | 10 #include <atlsecurity.h> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 SYSTEMTIME local_time; | 114 SYSTEMTIME local_time; |
| 115 ::GetSystemTime(&local_time); | 115 ::GetSystemTime(&local_time); |
| 116 std::string hex(base::HexEncode(&local_time, sizeof(local_time))); | 116 std::string hex(base::HexEncode(&local_time, sizeof(local_time))); |
| 117 base::StringPiece sp_hex(hex); | 117 base::StringPiece sp_hex(hex); |
| 118 hr = registrar->AddReplacement(L"SYSTIME", | 118 hr = registrar->AddReplacement(L"SYSTIME", |
| 119 base::SysNativeMBToWide(sp_hex).c_str()); | 119 base::SysNativeMBToWide(sp_hex).c_str()); |
| 120 DCHECK(SUCCEEDED(hr)); | 120 DCHECK(SUCCEEDED(hr)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 if (SUCCEEDED(hr)) { | 123 if (SUCCEEDED(hr)) { |
| 124 FilePath app_path = | 124 base::FilePath app_path = |
| 125 chrome_launcher::GetChromeExecutablePath().DirName(); | 125 chrome_launcher::GetChromeExecutablePath().DirName(); |
| 126 hr = registrar->AddReplacement(L"CHROME_APPPATH", | 126 hr = registrar->AddReplacement(L"CHROME_APPPATH", |
| 127 app_path.value().c_str()); | 127 app_path.value().c_str()); |
| 128 DCHECK(SUCCEEDED(hr)); | 128 DCHECK(SUCCEEDED(hr)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 if (SUCCEEDED(hr)) { | 131 if (SUCCEEDED(hr)) { |
| 132 hr = registrar->AddReplacement(L"CHROME_APPNAME", | 132 hr = registrar->AddReplacement(L"CHROME_APPNAME", |
| 133 chrome::kBrowserProcessExecutableName); | 133 chrome::kBrowserProcessExecutableName); |
| 134 DCHECK(SUCCEEDED(hr)); | 134 DCHECK(SUCCEEDED(hr)); |
| 135 | 135 |
| 136 // Fill in VERSION from the VERSIONINFO stored in the DLL's resources. | 136 // Fill in VERSION from the VERSIONINFO stored in the DLL's resources. |
| 137 scoped_ptr<FileVersionInfo> module_version_info( | 137 scoped_ptr<FileVersionInfo> module_version_info( |
| 138 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 138 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 139 DCHECK(module_version_info != NULL); | 139 DCHECK(module_version_info != NULL); |
| 140 std::wstring file_version(module_version_info->file_version()); | 140 std::wstring file_version(module_version_info->file_version()); |
| 141 hr = registrar->AddReplacement(L"VERSION", file_version.c_str()); | 141 hr = registrar->AddReplacement(L"VERSION", file_version.c_str()); |
| 142 DCHECK(SUCCEEDED(hr)); | 142 DCHECK(SUCCEEDED(hr)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 if (SUCCEEDED(hr)) { | 145 if (SUCCEEDED(hr)) { |
| 146 // Add the directory of chrome_launcher.exe. This will be the same | 146 // Add the directory of chrome_launcher.exe. This will be the same |
| 147 // as the directory for the current DLL. | 147 // as the directory for the current DLL. |
| 148 std::wstring module_dir; | 148 std::wstring module_dir; |
| 149 FilePath module_path; | 149 base::FilePath module_path; |
| 150 if (PathService::Get(base::FILE_MODULE, &module_path)) { | 150 if (PathService::Get(base::FILE_MODULE, &module_path)) { |
| 151 module_dir = module_path.DirName().value(); | 151 module_dir = module_path.DirName().value(); |
| 152 } else { | 152 } else { |
| 153 NOTREACHED(); | 153 NOTREACHED(); |
| 154 } | 154 } |
| 155 hr = registrar->AddReplacement(L"CHROME_LAUNCHER_APPPATH", | 155 hr = registrar->AddReplacement(L"CHROME_LAUNCHER_APPPATH", |
| 156 module_dir.c_str()); | 156 module_dir.c_str()); |
| 157 DCHECK(SUCCEEDED(hr)); | 157 DCHECK(SUCCEEDED(hr)); |
| 158 } | 158 } |
| 159 | 159 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // Helper method called for user-level installs where we don't have admin | 298 // Helper method called for user-level installs where we don't have admin |
| 299 // permissions. Starts up the long running process and registers it to get it | 299 // permissions. Starts up the long running process and registers it to get it |
| 300 // started at next boot. | 300 // started at next boot. |
| 301 HRESULT SetupUserLevelHelper() { | 301 HRESULT SetupUserLevelHelper() { |
| 302 HRESULT hr = S_OK; | 302 HRESULT hr = S_OK; |
| 303 | 303 |
| 304 // Remove existing run-at-startup entry. | 304 // Remove existing run-at-startup entry. |
| 305 base::win::RemoveCommandFromAutoRun(HKEY_CURRENT_USER, kRunKeyName); | 305 base::win::RemoveCommandFromAutoRun(HKEY_CURRENT_USER, kRunKeyName); |
| 306 | 306 |
| 307 // Build the chrome_frame_helper command line. | 307 // Build the chrome_frame_helper command line. |
| 308 FilePath module_path; | 308 base::FilePath module_path; |
| 309 FilePath helper_path; | 309 base::FilePath helper_path; |
| 310 if (PathService::Get(base::FILE_MODULE, &module_path)) { | 310 if (PathService::Get(base::FILE_MODULE, &module_path)) { |
| 311 module_path = module_path.DirName(); | 311 module_path = module_path.DirName(); |
| 312 helper_path = module_path.Append(kChromeFrameHelperExe); | 312 helper_path = module_path.Append(kChromeFrameHelperExe); |
| 313 if (!file_util::PathExists(helper_path)) { | 313 if (!file_util::PathExists(helper_path)) { |
| 314 // If we can't find the helper in the current directory, try looking | 314 // If we can't find the helper in the current directory, try looking |
| 315 // one up (this is the layout in the build output folder). | 315 // one up (this is the layout in the build output folder). |
| 316 module_path = module_path.DirName(); | 316 module_path = module_path.DirName(); |
| 317 helper_path = module_path.Append(kChromeFrameHelperExe); | 317 helper_path = module_path.Append(kChromeFrameHelperExe); |
| 318 DCHECK(file_util::PathExists(helper_path)) << | 318 DCHECK(file_util::PathExists(helper_path)) << |
| 319 "Could not find chrome_frame_helper.exe."; | 319 "Could not find chrome_frame_helper.exe."; |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 HRESULT hr = CustomRegistration(ALL, FALSE, false); | 939 HRESULT hr = CustomRegistration(ALL, FALSE, false); |
| 940 return hr; | 940 return hr; |
| 941 } | 941 } |
| 942 | 942 |
| 943 // Object entries go here instead of with each object, so that we can move | 943 // Object entries go here instead of with each object, so that we can move |
| 944 // the objects to a lib. Also reduces magic. | 944 // the objects to a lib. Also reduces magic. |
| 945 OBJECT_ENTRY_AUTO(CLSID_ChromeFrameBHO, Bho) | 945 OBJECT_ENTRY_AUTO(CLSID_ChromeFrameBHO, Bho) |
| 946 OBJECT_ENTRY_AUTO(__uuidof(ChromeActiveDocument), ChromeActiveDocument) | 946 OBJECT_ENTRY_AUTO(__uuidof(ChromeActiveDocument), ChromeActiveDocument) |
| 947 OBJECT_ENTRY_AUTO(__uuidof(ChromeFrame), ChromeFrameActivex) | 947 OBJECT_ENTRY_AUTO(__uuidof(ChromeFrame), ChromeFrameActivex) |
| 948 OBJECT_ENTRY_AUTO(__uuidof(ChromeProtocol), ChromeProtocol) | 948 OBJECT_ENTRY_AUTO(__uuidof(ChromeProtocol), ChromeProtocol) |
| OLD | NEW |