Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/browser/google/google_update_win.h

Issue 10698106: Switch about box to web ui on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: With GoogleUpdate on Windows only. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_H_ 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_
6 #define CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_H_ 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #if defined(OS_WIN)
13 #include "google_update/google_update_idl.h" 12 #include "google_update/google_update_idl.h"
14 #endif
15 13
16 class MessageLoop; 14 class MessageLoop;
17 namespace views { 15 namespace views {
18 class Widget; 16 class Widget;
19 } 17 }
20 18
21 // The status of the upgrade. UPGRADE_STARTED and UPGRADE_CHECK_STARTED are 19 // The status of the upgrade. UPGRADE_STARTED and UPGRADE_CHECK_STARTED are
22 // internal states and will not be reported as results to the listener. 20 // internal states and will not be reported as results to the listener.
23 enum GoogleUpdateUpgradeResult { 21 enum GoogleUpdateUpgradeResult {
24 // The upgrade has started. 22 // The upgrade has started.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { 86 class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> {
89 public: 87 public:
90 GoogleUpdate(); 88 GoogleUpdate();
91 89
92 // Ask Google Update to see if a new version is available. If the parameter 90 // Ask Google Update to see if a new version is available. If the parameter
93 // |install_if_newer| is true then Google Update will also install that new 91 // |install_if_newer| is true then Google Update will also install that new
94 // version. 92 // version.
95 // |window| should point to a foreground window. This is needed to ensure 93 // |window| should point to a foreground window. This is needed to ensure
96 // that Vista/Windows 7 UAC prompts show up in the foreground. It may also 94 // that Vista/Windows 7 UAC prompts show up in the foreground. It may also
97 // be null. 95 // be null.
98 void CheckForUpdate(bool install_if_newer, views::Widget* window); 96 void CheckForUpdate(bool install_if_newer, HWND window);
99 97
100 // Pass NULL to clear the listener 98 // Pass NULL to clear the listener
101 void set_status_listener(GoogleUpdateStatusListener* listener) { 99 void set_status_listener(GoogleUpdateStatusListener* listener) {
102 listener_ = listener; 100 listener_ = listener;
103 } 101 }
104 102
105 private: 103 private:
106 friend class base::RefCountedThreadSafe<GoogleUpdate>; 104 friend class base::RefCountedThreadSafe<GoogleUpdate>;
107 105
108 virtual ~GoogleUpdate(); 106 virtual ~GoogleUpdate();
109 107
110 // The chromeos implementation is in browser/chromeos/google_update.cpp
111
112 #if defined(OS_WIN)
113
114 // This function reports failure from the Google Update operation to the 108 // This function reports failure from the Google Update operation to the
115 // listener. 109 // listener.
116 // Note, after this function completes, this object will have deleted itself. 110 // Note, after this function completes, this object will have deleted itself.
117 bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, 111 bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code,
118 const string16& error_message, MessageLoop* main_loop); 112 const string16& error_message, MessageLoop* main_loop);
119 113
120 #endif
121
122 // We need to run the update check on another thread than the main thread, and 114 // We need to run the update check on another thread than the main thread, and
123 // therefore CheckForUpdate will delegate to this function. |main_loop| points 115 // therefore CheckForUpdate will delegate to this function. |main_loop| points
124 // to the message loop that we want the response to come from. 116 // to the message loop that we want the response to come from.
125 // |window| should point to a foreground window. This is needed to ensure that 117 // |window| should point to a foreground window. This is needed to ensure that
126 // Vista/Windows 7 UAC prompts show up in the foreground. It may also be null. 118 // Vista/Windows 7 UAC prompts show up in the foreground. It may also be null.
127 void InitiateGoogleUpdateCheck(bool install_if_newer, views::Widget* window, 119 void InitiateGoogleUpdateCheck(bool install_if_newer, HWND window,
128 MessageLoop* main_loop); 120 MessageLoop* main_loop);
129 121
130 // This function reports the results of the GoogleUpdate operation to the 122 // This function reports the results of the GoogleUpdate operation to the
131 // listener. If results indicates an error, the |error_code| and 123 // listener. If results indicates an error, the |error_code| and
132 // |error_message| will indicate which error occurred. 124 // |error_message| will indicate which error occurred.
133 // Note, after this function completes, this object will have deleted itself. 125 // Note, after this function completes, this object will have deleted itself.
134 void ReportResults(GoogleUpdateUpgradeResult results, 126 void ReportResults(GoogleUpdateUpgradeResult results,
135 GoogleUpdateErrorCode error_code, 127 GoogleUpdateErrorCode error_code,
136 const string16& error_message); 128 const string16& error_message);
137 129
138 // Which version string Google Update found (if a new one was available). 130 // Which version string Google Update found (if a new one was available).
139 // Otherwise, this will be blank. 131 // Otherwise, this will be blank.
140 string16 version_available_; 132 string16 version_available_;
141 133
142 // The listener who is interested in finding out the result of the operation. 134 // The listener who is interested in finding out the result of the operation.
143 GoogleUpdateStatusListener* listener_; 135 GoogleUpdateStatusListener* listener_;
144 136
145 DISALLOW_COPY_AND_ASSIGN(GoogleUpdate); 137 DISALLOW_COPY_AND_ASSIGN(GoogleUpdate);
146 }; 138 };
147 139
148 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_H_ 140 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_UPDATE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698