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

Side by Side Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 2052603002: Restore calls to MessageLoopForUI::current in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing includes Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/ash/media_delegate_chromeos.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 "chrome/browser/ui/views/chrome_views_delegate.h" 5 #include "chrome/browser/ui/views/chrome_views_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/location.h"
10 #include "base/message_loop/message_loop.h"
9 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
11 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
12 #include "base/threading/thread_task_runner_handle.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/lifetime/keep_alive_types.h" 17 #include "chrome/browser/lifetime/keep_alive_types.h"
17 #include "chrome/browser/lifetime/scoped_keep_alive.h" 18 #include "chrome/browser/lifetime/scoped_keep_alive.h"
18 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
19 #include "chrome/browser/ui/browser_window_state.h" 20 #include "chrome/browser/ui/browser_window_state.h"
20 #include "components/prefs/pref_service.h" 21 #include "components/prefs/pref_service.h"
21 #include "components/prefs/scoped_user_pref_update.h" 22 #include "components/prefs/scoped_user_pref_update.h"
22 #include "components/version_info/version_info.h" 23 #include "components/version_info/version_info.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( 271 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing(
271 const ui::Accelerator& accelerator) { 272 const ui::Accelerator& accelerator) {
272 #if defined(USE_ASH) 273 #if defined(USE_ASH)
273 ash::AcceleratorController* accelerator_controller = 274 ash::AcceleratorController* accelerator_controller =
274 ash::Shell::GetInstance()->accelerator_controller(); 275 ash::Shell::GetInstance()->accelerator_controller();
275 276
276 accelerator_controller->accelerator_history()->StoreCurrentAccelerator( 277 accelerator_controller->accelerator_history()->StoreCurrentAccelerator(
277 accelerator); 278 accelerator);
278 if (accelerator_controller->ShouldCloseMenuAndRepostAccelerator( 279 if (accelerator_controller->ShouldCloseMenuAndRepostAccelerator(
279 accelerator)) { 280 accelerator)) {
280 base::ThreadTaskRunnerHandle::Get()->PostTask( 281 base::MessageLoopForUI::current()->task_runner()->PostTask(
281 FROM_HERE, base::Bind(ProcessAcceleratorNow, accelerator)); 282 FROM_HERE, base::Bind(ProcessAcceleratorNow, accelerator));
282 return views::ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU; 283 return views::ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU;
283 } 284 }
284 285
285 ProcessAcceleratorNow(accelerator); 286 ProcessAcceleratorNow(accelerator);
286 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; 287 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN;
287 #else 288 #else
288 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; 289 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN;
289 #endif // defined(USE_ASH) 290 #endif // defined(USE_ASH)
290 } 291 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 return content::BrowserThread::GetBlockingPool(); 500 return content::BrowserThread::GetBlockingPool();
500 } 501 }
501 502
502 #if !defined(USE_ASH) 503 #if !defined(USE_ASH)
503 views::Widget::InitParams::WindowOpacity 504 views::Widget::InitParams::WindowOpacity
504 ChromeViewsDelegate::GetOpacityForInitParams( 505 ChromeViewsDelegate::GetOpacityForInitParams(
505 const views::Widget::InitParams& params) { 506 const views::Widget::InitParams& params) {
506 return views::Widget::InitParams::OPAQUE_WINDOW; 507 return views::Widget::InitParams::OPAQUE_WINDOW;
507 } 508 }
508 #endif 509 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/media_delegate_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698