| 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 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_ | 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "google_update/google_update_idl.h" | 11 #include "google_update/google_update_idl.h" |
| 12 | 12 |
| 13 namespace base { |
| 13 class MessageLoop; | 14 class MessageLoop; |
| 15 } |
| 16 |
| 14 namespace views { | 17 namespace views { |
| 15 class Widget; | 18 class Widget; |
| 16 } | 19 } |
| 17 | 20 |
| 18 // The status of the upgrade. UPGRADE_STARTED and UPGRADE_CHECK_STARTED are | 21 // The status of the upgrade. UPGRADE_STARTED and UPGRADE_CHECK_STARTED are |
| 19 // internal states and will not be reported as results to the listener. | 22 // internal states and will not be reported as results to the listener. |
| 20 enum GoogleUpdateUpgradeResult { | 23 enum GoogleUpdateUpgradeResult { |
| 21 // The upgrade has started. | 24 // The upgrade has started. |
| 22 UPGRADE_STARTED = 0, | 25 UPGRADE_STARTED = 0, |
| 23 // A check for upgrade has been initiated. | 26 // A check for upgrade has been initiated. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 104 |
| 102 private: | 105 private: |
| 103 friend class base::RefCountedThreadSafe<GoogleUpdate>; | 106 friend class base::RefCountedThreadSafe<GoogleUpdate>; |
| 104 | 107 |
| 105 virtual ~GoogleUpdate(); | 108 virtual ~GoogleUpdate(); |
| 106 | 109 |
| 107 // This function reports failure from the Google Update operation to the | 110 // This function reports failure from the Google Update operation to the |
| 108 // listener. | 111 // listener. |
| 109 // Note, after this function completes, this object will have deleted itself. | 112 // Note, after this function completes, this object will have deleted itself. |
| 110 bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, | 113 bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, |
| 111 const string16& error_message, MessageLoop* main_loop); | 114 const string16& error_message, |
| 115 base::MessageLoop* main_loop); |
| 112 | 116 |
| 113 // The update check needs to run on another thread than the main thread, and | 117 // The update check needs to run on another thread than the main thread, and |
| 114 // therefore CheckForUpdate will delegate to this function. |main_loop| points | 118 // therefore CheckForUpdate will delegate to this function. |main_loop| points |
| 115 // to the message loop that the response must come from. | 119 // to the message loop that the response must come from. |
| 116 // |window| should point to a foreground window. This is needed to ensure that | 120 // |window| should point to a foreground window. This is needed to ensure that |
| 117 // Vista/Windows 7 UAC prompts show up in the foreground. It may also be null. | 121 // Vista/Windows 7 UAC prompts show up in the foreground. It may also be null. |
| 118 void InitiateGoogleUpdateCheck(bool install_if_newer, HWND window, | 122 void InitiateGoogleUpdateCheck(bool install_if_newer, HWND window, |
| 119 MessageLoop* main_loop); | 123 base::MessageLoop* main_loop); |
| 120 | 124 |
| 121 // This function reports the results of the GoogleUpdate operation to the | 125 // This function reports the results of the GoogleUpdate operation to the |
| 122 // listener. If results indicates an error, the |error_code| and | 126 // listener. If results indicates an error, the |error_code| and |
| 123 // |error_message| will indicate which error occurred. | 127 // |error_message| will indicate which error occurred. |
| 124 // Note, after this function completes, this object will have deleted itself. | 128 // Note, after this function completes, this object will have deleted itself. |
| 125 void ReportResults(GoogleUpdateUpgradeResult results, | 129 void ReportResults(GoogleUpdateUpgradeResult results, |
| 126 GoogleUpdateErrorCode error_code, | 130 GoogleUpdateErrorCode error_code, |
| 127 const string16& error_message); | 131 const string16& error_message); |
| 128 | 132 |
| 129 // Which version string Google Update found (if a new one was available). | 133 // Which version string Google Update found (if a new one was available). |
| 130 // Otherwise, this will be blank. | 134 // Otherwise, this will be blank. |
| 131 string16 version_available_; | 135 string16 version_available_; |
| 132 | 136 |
| 133 // The listener who is interested in finding out the result of the operation. | 137 // The listener who is interested in finding out the result of the operation. |
| 134 GoogleUpdateStatusListener* listener_; | 138 GoogleUpdateStatusListener* listener_; |
| 135 | 139 |
| 136 DISALLOW_COPY_AND_ASSIGN(GoogleUpdate); | 140 DISALLOW_COPY_AND_ASSIGN(GoogleUpdate); |
| 137 }; | 141 }; |
| 138 | 142 |
| 139 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_ | 143 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_ |
| OLD | NEW |