OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2454 free(accelerators); | 2454 free(accelerators); |
2455 #else | 2455 #else |
2456 views::FocusManager* focus_manager = GetFocusManager(); | 2456 views::FocusManager* focus_manager = GetFocusManager(); |
2457 DCHECK(focus_manager); | 2457 DCHECK(focus_manager); |
2458 | 2458 |
2459 // Let's fill our own accelerator table. | 2459 // Let's fill our own accelerator table. |
2460 const std::vector<chrome::AcceleratorMapping> accelerator_list( | 2460 const std::vector<chrome::AcceleratorMapping> accelerator_list( |
2461 chrome::GetAcceleratorList()); | 2461 chrome::GetAcceleratorList()); |
2462 for (std::vector<chrome::AcceleratorMapping>::const_iterator it = | 2462 for (std::vector<chrome::AcceleratorMapping>::const_iterator it = |
2463 accelerator_list.begin(); it != accelerator_list.end(); ++it) { | 2463 accelerator_list.begin(); it != accelerator_list.end(); ++it) { |
2464 #if defined(OS_CHROMEOS) | |
sky
2013/03/04 22:25:14
Don't we want this when in ash mode too?
xiyuan
2013/03/04 22:38:32
Good point. Removed.
| |
2465 // Only allow accelerators of white listed commands to pass through. | |
2466 static const bool is_app_mode = chrome::IsRunningInForcedAppMode(); | |
sky
2013/03/04 22:25:14
Is there a compelling reason to make this static?
xiyuan
2013/03/04 22:38:32
Moved it outside the loop and removed "static".
| |
2467 if (is_app_mode && !chrome::IsCommandAllowedInAppMode(it->command_id)) | |
2468 continue; | |
2469 #endif | |
2470 | |
2464 ui::Accelerator accelerator(it->keycode, it->modifiers); | 2471 ui::Accelerator accelerator(it->keycode, it->modifiers); |
2465 accelerator_table_[accelerator] = it->command_id; | 2472 accelerator_table_[accelerator] = it->command_id; |
2466 | 2473 |
2467 // Also register with the focus manager. | 2474 // Also register with the focus manager. |
2468 focus_manager->RegisterAccelerator( | 2475 focus_manager->RegisterAccelerator( |
2469 accelerator, ui::AcceleratorManager::kNormalPriority, this); | 2476 accelerator, ui::AcceleratorManager::kNormalPriority, this); |
2470 } | 2477 } |
2471 #endif | 2478 #endif |
2472 } | 2479 } |
2473 | 2480 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2723 | 2730 |
2724 Browser* modal_browser = | 2731 Browser* modal_browser = |
2725 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); | 2732 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); |
2726 if (modal_browser && (browser_ != modal_browser)) { | 2733 if (modal_browser && (browser_ != modal_browser)) { |
2727 modal_browser->window()->FlashFrame(true); | 2734 modal_browser->window()->FlashFrame(true); |
2728 modal_browser->window()->Activate(); | 2735 modal_browser->window()->Activate(); |
2729 } | 2736 } |
2730 | 2737 |
2731 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2738 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2732 } | 2739 } |
OLD | NEW |