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

Side by Side Diff: chrome/browser/ui/webui/help/version_updater_win.cc

Issue 723803002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/version.h" 9 #include "base/version.h"
10 #include "base/win/win_util.h" 10 #include "base/win/win_util.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 // On-demand updates for Chrome don't work in Vista RTM when UAC is turned 137 // On-demand updates for Chrome don't work in Vista RTM when UAC is turned
138 // off. So, in this case, the version updater must not mention 138 // off. So, in this case, the version updater must not mention
139 // on-demand updates. Silent updates (in the background) should still 139 // on-demand updates. Silent updates (in the background) should still
140 // work as before - enabling UAC or installing the latest service pack 140 // work as before - enabling UAC or installing the latest service pack
141 // for Vista is another option. 141 // for Vista is another option.
142 if (!(base::win::GetVersion() == base::win::VERSION_VISTA && 142 if (!(base::win::GetVersion() == base::win::VERSION_VISTA &&
143 (base::win::OSInfo::GetInstance()->service_pack().major == 0) && 143 (base::win::OSInfo::GetInstance()->service_pack().major == 0) &&
144 !base::win::UserAccountControlIsEnabled())) { 144 !base::win::UserAccountControlIsEnabled())) {
145 // This could happen if the page got refreshed after results were returned. 145 // This could happen if the page got refreshed after results were returned.
146 if (!google_updater_) 146 if (!google_updater_.get())
147 CreateGoogleUpdater(); 147 CreateGoogleUpdater();
148 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR, 148 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR,
149 base::string16()); 149 base::string16());
150 // Specify false to not upgrade yet. 150 // Specify false to not upgrade yet.
151 google_updater_->CheckForUpdate(false, GetElevationParent()); 151 google_updater_->CheckForUpdate(false, GetElevationParent());
152 } 152 }
153 } 153 }
154 154
155 void VersionUpdaterWin::RelaunchBrowser() const { 155 void VersionUpdaterWin::RelaunchBrowser() const {
156 chrome::AttemptRestart(); 156 chrome::AttemptRestart();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 base::string16()); 252 base::string16());
253 } 253 }
254 254
255 void VersionUpdaterWin::CreateGoogleUpdater() { 255 void VersionUpdaterWin::CreateGoogleUpdater() {
256 ClearGoogleUpdater(); 256 ClearGoogleUpdater();
257 google_updater_ = new GoogleUpdate(); 257 google_updater_ = new GoogleUpdate();
258 google_updater_->set_status_listener(this); 258 google_updater_->set_status_listener(this);
259 } 259 }
260 260
261 void VersionUpdaterWin::ClearGoogleUpdater() { 261 void VersionUpdaterWin::ClearGoogleUpdater() {
262 if (google_updater_) { 262 if (google_updater_.get()) {
263 google_updater_->set_status_listener(NULL); 263 google_updater_->set_status_listener(NULL);
264 google_updater_ = NULL; 264 google_updater_ = NULL;
265 } 265 }
266 } 266 }
267 267
268 BOOL CALLBACK WindowEnumeration(HWND window, LPARAM param) { 268 BOOL CALLBACK WindowEnumeration(HWND window, LPARAM param) {
269 if (IsWindowVisible(window)) { 269 if (IsWindowVisible(window)) {
270 HWND* returned_window = reinterpret_cast<HWND*>(param); 270 HWND* returned_window = reinterpret_cast<HWND*>(param);
271 *returned_window = window; 271 *returned_window = window;
272 return FALSE; 272 return FALSE;
(...skipping 15 matching lines...) Expand all
288 << GetCurrentThreadId(); 288 << GetCurrentThreadId();
289 #endif 289 #endif
290 return window; 290 return window;
291 } 291 }
292 292
293 } // namespace 293 } // namespace
294 294
295 VersionUpdater* VersionUpdater::Create() { 295 VersionUpdater* VersionUpdater::Create() {
296 return new VersionUpdaterWin; 296 return new VersionUpdaterWin;
297 } 297 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698