| 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 #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/single_thread_task_runner.h" |
| 9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 12 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 13 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/lifetime/keep_alive_types.h" | 16 #include "chrome/browser/lifetime/keep_alive_types.h" |
| 15 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 17 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/browser_window_state.h" | 19 #include "chrome/browser/ui/browser_window_state.h" |
| 18 #include "components/prefs/pref_service.h" | 20 #include "components/prefs/pref_service.h" |
| 19 #include "components/prefs/scoped_user_pref_update.h" | 21 #include "components/prefs/scoped_user_pref_update.h" |
| 20 #include "components/version_info/version_info.h" | 22 #include "components/version_info/version_info.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( | 270 ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( |
| 269 const ui::Accelerator& accelerator) { | 271 const ui::Accelerator& accelerator) { |
| 270 #if defined(USE_ASH) | 272 #if defined(USE_ASH) |
| 271 ash::AcceleratorController* accelerator_controller = | 273 ash::AcceleratorController* accelerator_controller = |
| 272 ash::Shell::GetInstance()->accelerator_controller(); | 274 ash::Shell::GetInstance()->accelerator_controller(); |
| 273 | 275 |
| 274 accelerator_controller->accelerator_history()->StoreCurrentAccelerator( | 276 accelerator_controller->accelerator_history()->StoreCurrentAccelerator( |
| 275 accelerator); | 277 accelerator); |
| 276 if (accelerator_controller->ShouldCloseMenuAndRepostAccelerator( | 278 if (accelerator_controller->ShouldCloseMenuAndRepostAccelerator( |
| 277 accelerator)) { | 279 accelerator)) { |
| 278 base::MessageLoopForUI::current()->PostTask( | 280 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 279 FROM_HERE, | 281 FROM_HERE, base::Bind(ProcessAcceleratorNow, accelerator)); |
| 280 base::Bind(ProcessAcceleratorNow, accelerator)); | |
| 281 return views::ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU; | 282 return views::ViewsDelegate::ProcessMenuAcceleratorResult::CLOSE_MENU; |
| 282 } | 283 } |
| 283 | 284 |
| 284 ProcessAcceleratorNow(accelerator); | 285 ProcessAcceleratorNow(accelerator); |
| 285 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; | 286 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; |
| 286 #else | 287 #else |
| 287 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; | 288 return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; |
| 288 #endif // defined(USE_ASH) | 289 #endif // defined(USE_ASH) |
| 289 } | 290 } |
| 290 | 291 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 return content::BrowserThread::GetBlockingPool(); | 499 return content::BrowserThread::GetBlockingPool(); |
| 499 } | 500 } |
| 500 | 501 |
| 501 #if !defined(USE_ASH) | 502 #if !defined(USE_ASH) |
| 502 views::Widget::InitParams::WindowOpacity | 503 views::Widget::InitParams::WindowOpacity |
| 503 ChromeViewsDelegate::GetOpacityForInitParams( | 504 ChromeViewsDelegate::GetOpacityForInitParams( |
| 504 const views::Widget::InitParams& params) { | 505 const views::Widget::InitParams& params) { |
| 505 return views::Widget::InitParams::OPAQUE_WINDOW; | 506 return views::Widget::InitParams::OPAQUE_WINDOW; |
| 506 } | 507 } |
| 507 #endif | 508 #endif |
| OLD | NEW |