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

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

Issue 909183002: win/aura: Remove some more non-aura code for Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 return TRUE; 244 return TRUE;
245 } 245 }
246 246
247 gfx::AcceleratedWidget VersionUpdaterWin::GetElevationParent() { 247 gfx::AcceleratedWidget VersionUpdaterWin::GetElevationParent() {
248 // Look for a visible window belonging to the UI thread. 248 // Look for a visible window belonging to the UI thread.
249 DCHECK_CURRENTLY_ON(BrowserThread::UI); 249 DCHECK_CURRENTLY_ON(BrowserThread::UI);
250 HWND window = NULL; 250 HWND window = NULL;
251 EnumThreadWindows(GetCurrentThreadId(), 251 EnumThreadWindows(GetCurrentThreadId(),
252 WindowEnumeration, 252 WindowEnumeration,
253 reinterpret_cast<LPARAM>(&window)); 253 reinterpret_cast<LPARAM>(&window));
254 #if !defined(USE_AURA)
255 // If using Aura, we might not have a Visible window in this process. In
256 // theory Google update can cope with that.
257 DCHECK(window != NULL) << "Failed to find a valid window handle on thread: "
258 << GetCurrentThreadId();
259 #endif
260 return window; 254 return window;
261 } 255 }
262 256
263 void VersionUpdaterWin::BeginUpdateCheckOnFileThread(bool install_if_newer) { 257 void VersionUpdaterWin::BeginUpdateCheckOnFileThread(bool install_if_newer) {
264 scoped_refptr<base::TaskRunner> task_runner( 258 scoped_refptr<base::TaskRunner> task_runner(
265 content::BrowserThread::GetMessageLoopProxyForThread( 259 content::BrowserThread::GetMessageLoopProxyForThread(
266 content::BrowserThread::FILE)); 260 content::BrowserThread::FILE));
267 BeginUpdateCheck(task_runner, install_if_newer, GetElevationParent(), 261 BeginUpdateCheck(task_runner, install_if_newer, GetElevationParent(),
268 base::Bind(&VersionUpdaterWin::OnUpdateCheckResults, 262 base::Bind(&VersionUpdaterWin::OnUpdateCheckResults,
269 weak_factory_.GetWeakPtr())); 263 weak_factory_.GetWeakPtr()));
270 } 264 }
271 265
272 } // namespace 266 } // namespace
273 267
274 VersionUpdater* VersionUpdater::Create(content::BrowserContext* /* context */) { 268 VersionUpdater* VersionUpdater::Create(content::BrowserContext* /* context */) {
275 return new VersionUpdaterWin; 269 return new VersionUpdaterWin;
276 } 270 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/pdf/pdf_unsupported_feature.cc ('k') | components/crash/app/hard_error_handler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698