| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/google/google_update.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" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/task.h" | 16 #include "base/task.h" |
| 17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 18 #include "base/win/scoped_comptr.h" | 18 #include "base/win/scoped_comptr.h" |
| 19 #include "base/win/windows_version.h" | 19 #include "base/win/windows_version.h" |
| 20 #include "chrome/installer/util/browser_distribution.h" | 20 #include "chrome/installer/util/browser_distribution.h" |
| 21 #include "chrome/installer/util/google_update_settings.h" | 21 #include "chrome/installer/util/google_update_settings.h" |
| 22 #include "chrome/installer/util/helper.h" | 22 #include "chrome/installer/util/helper.h" |
| 23 #include "chrome/installer/util/install_util.h" | 23 #include "chrome/installer/util/install_util.h" |
| 24 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 25 #include "google_update_idl_i.c" | 25 #include "google_update_idl_i.c" |
| 26 #include "views/widget/widget.h" | 26 #include "views/widget/widget.h" |
| 27 | 27 |
| 28 using content::BrowserThread; |
| 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 // Check if the currently running instance can be updated by Google Update. | 32 // Check if the currently running instance can be updated by Google Update. |
| 31 // Returns GOOGLE_UPDATE_NO_ERROR only if the instance running is a Google | 33 // Returns GOOGLE_UPDATE_NO_ERROR only if the instance running is a Google |
| 32 // Chrome distribution installed in a standard location. | 34 // Chrome distribution installed in a standard location. |
| 33 GoogleUpdateErrorCode CanUpdateCurrentChrome( | 35 GoogleUpdateErrorCode CanUpdateCurrentChrome( |
| 34 const std::wstring& chrome_exe_path) { | 36 const std::wstring& chrome_exe_path) { |
| 35 #if !defined(GOOGLE_CHROME_BUILD) | 37 #if !defined(GOOGLE_CHROME_BUILD) |
| 36 return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; | 38 return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; |
| 37 #else | 39 #else |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 bool GoogleUpdate::ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, | 359 bool GoogleUpdate::ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, |
| 358 MessageLoop* main_loop) { | 360 MessageLoop* main_loop) { |
| 359 NOTREACHED() << "Communication with Google Update failed: " << hr | 361 NOTREACHED() << "Communication with Google Update failed: " << hr |
| 360 << " error: " << error_code; | 362 << " error: " << error_code; |
| 361 main_loop->PostTask( | 363 main_loop->PostTask( |
| 362 FROM_HERE, | 364 FROM_HERE, |
| 363 base::Bind(&GoogleUpdate::ReportResults, this, | 365 base::Bind(&GoogleUpdate::ReportResults, this, |
| 364 UPGRADE_ERROR, error_code)); | 366 UPGRADE_ERROR, error_code)); |
| 365 return false; | 367 return false; |
| 366 } | 368 } |
| OLD | NEW |