Chromium Code Reviews| 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 #include "chrome/browser/google/google_update_win.h" | 5 #include "chrome/browser/google/google_update_win.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 << L". The standard location is: " | 53 << L". The standard location is: " |
| 54 << user_exe_path.value().c_str() | 54 << user_exe_path.value().c_str() |
| 55 << L" or " << machine_exe_path.value().c_str() << L"."; | 55 << L" or " << machine_exe_path.value().c_str() << L"."; |
| 56 return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; | 56 return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; |
| 57 } | 57 } |
| 58 | 58 |
| 59 string16 app_guid = installer::GetAppGuidForUpdates( | 59 string16 app_guid = installer::GetAppGuidForUpdates( |
| 60 !InstallUtil::IsPerUserInstall(chrome_exe_path.value().c_str())); | 60 !InstallUtil::IsPerUserInstall(chrome_exe_path.value().c_str())); |
| 61 DCHECK(!app_guid.empty()); | 61 DCHECK(!app_guid.empty()); |
| 62 | 62 |
| 63 if (GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, NULL) == | 63 if (GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, NULL) == |
|
Peter Kasting
2013/06/20 17:55:19
Nit: Cache the result of this in a temp variable s
Ryan Myers (chromium)
2013/06/20 19:57:11
Done.
| |
| 64 GoogleUpdateSettings::UPDATES_DISABLED) | 64 GoogleUpdateSettings::UPDATES_DISABLED) |
| 65 return GOOGLE_UPDATE_DISABLED_BY_POLICY; | 65 return GOOGLE_UPDATE_DISABLED_BY_POLICY; |
| 66 | 66 |
| 67 if (GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, NULL) == | |
| 68 GoogleUpdateSettings::AUTO_UPDATES_ONLY) | |
| 69 return GOOGLE_UPDATE_DISABLED_BY_POLICY_AUTO_ONLY; | |
| 70 | |
| 67 return GOOGLE_UPDATE_NO_ERROR; | 71 return GOOGLE_UPDATE_NO_ERROR; |
| 68 #endif | 72 #endif |
| 69 } | 73 } |
| 70 | 74 |
| 71 // Creates an instance of a COM Local Server class using either plain vanilla | 75 // Creates an instance of a COM Local Server class using either plain vanilla |
| 72 // CoCreateInstance, or using the Elevation moniker if running on Vista. | 76 // CoCreateInstance, or using the Elevation moniker if running on Vista. |
| 73 // hwnd must refer to a foregound window in order to get the UAC prompt | 77 // hwnd must refer to a foregound window in order to get the UAC prompt |
| 74 // showing up in the foreground if running on Vista. It can also be NULL if | 78 // showing up in the foreground if running on Vista. It can also be NULL if |
| 75 // background UAC prompts are desired. | 79 // background UAC prompts are desired. |
| 76 HRESULT CoCreateInstanceAsAdmin(REFCLSID class_id, REFIID interface_id, | 80 HRESULT CoCreateInstanceAsAdmin(REFCLSID class_id, REFIID interface_id, |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 base::MessageLoop* main_loop) { | 402 base::MessageLoop* main_loop) { |
| 399 NOTREACHED() << "Communication with Google Update failed: " << hr | 403 NOTREACHED() << "Communication with Google Update failed: " << hr |
| 400 << " error: " << error_code | 404 << " error: " << error_code |
| 401 << ", message: " << error_message.c_str(); | 405 << ", message: " << error_message.c_str(); |
| 402 main_loop->PostTask( | 406 main_loop->PostTask( |
| 403 FROM_HERE, | 407 FROM_HERE, |
| 404 base::Bind(&GoogleUpdate::ReportResults, this, | 408 base::Bind(&GoogleUpdate::ReportResults, this, |
| 405 UPGRADE_ERROR, error_code, error_message)); | 409 UPGRADE_ERROR, error_code, error_message)); |
| 406 return false; | 410 return false; |
| 407 } | 411 } |
| OLD | NEW |