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

Side by Side Diff: chrome/browser/views/frame/browser_view.cc

Issue 224023: Don't send tab switching/killing/creating keyboard accelerators to pages. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: call Browser:IsReservedAccelerator from tab_contents_view.cc instead of each platform file Created 11 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #include "app/drag_drop_types.h" 7 #include "app/drag_drop_types.h"
8 #include "app/gfx/canvas.h" 8 #include "app/gfx/canvas.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/os_exchange_data.h" 10 #include "app/os_exchange_data.h"
11 #include "app/resource_bundle.h" 11 #include "app/resource_bundle.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/keyboard_codes.h" 13 #include "base/keyboard_codes.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "base/win_util.h"
15 #include "build/build_config.h" 16 #include "build/build_config.h"
16 #include "chrome/app/chrome_dll_resource.h" 17 #include "chrome/app/chrome_dll_resource.h"
17 #include "chrome/browser/app_modal_dialog_queue.h" 18 #include "chrome/browser/app_modal_dialog_queue.h"
18 #include "chrome/browser/bookmarks/bookmark_utils.h" 19 #include "chrome/browser/bookmarks/bookmark_utils.h"
19 #include "chrome/browser/browser.h" 20 #include "chrome/browser/browser.h"
20 #include "chrome/browser/browser_list.h" 21 #include "chrome/browser/browser_list.h"
21 #include "chrome/browser/browser_process.h" 22 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/browser_theme_provider.h" 23 #include "chrome/browser/browser_theme_provider.h"
23 #include "chrome/browser/debugger/devtools_window.h" 24 #include "chrome/browser/debugger/devtools_window.h"
24 #include "chrome/browser/download/download_manager.h" 25 #include "chrome/browser/download/download_manager.h"
(...skipping 16 matching lines...) Expand all
41 #include "chrome/browser/views/tabs/browser_tab_strip.h" 42 #include "chrome/browser/views/tabs/browser_tab_strip.h"
42 #include "chrome/browser/views/tabs/tab_strip.h" 43 #include "chrome/browser/views/tabs/tab_strip.h"
43 #include "chrome/browser/views/toolbar_star_toggle.h" 44 #include "chrome/browser/views/toolbar_star_toggle.h"
44 #include "chrome/browser/views/toolbar_view.h" 45 #include "chrome/browser/views/toolbar_view.h"
45 #include "chrome/browser/sessions/tab_restore_service.h" 46 #include "chrome/browser/sessions/tab_restore_service.h"
46 #include "chrome/browser/tab_contents/navigation_entry.h" 47 #include "chrome/browser/tab_contents/navigation_entry.h"
47 #include "chrome/browser/tab_contents/tab_contents.h" 48 #include "chrome/browser/tab_contents/tab_contents.h"
48 #include "chrome/browser/tab_contents/tab_contents_view.h" 49 #include "chrome/browser/tab_contents/tab_contents_view.h"
49 #include "chrome/browser/window_sizer.h" 50 #include "chrome/browser/window_sizer.h"
50 #include "chrome/common/chrome_switches.h" 51 #include "chrome/common/chrome_switches.h"
52 #include "chrome/common/native_web_keyboard_event.h"
51 #include "chrome/common/native_window_notification_source.h" 53 #include "chrome/common/native_window_notification_source.h"
52 #include "chrome/common/notification_service.h" 54 #include "chrome/common/notification_service.h"
53 #include "chrome/common/pref_names.h" 55 #include "chrome/common/pref_names.h"
54 #include "chrome/common/pref_service.h" 56 #include "chrome/common/pref_service.h"
55 #include "grit/app_resources.h" 57 #include "grit/app_resources.h"
56 #include "grit/chromium_strings.h" 58 #include "grit/chromium_strings.h"
57 #include "grit/generated_resources.h" 59 #include "grit/generated_resources.h"
58 #include "grit/theme_resources.h" 60 #include "grit/theme_resources.h"
59 #include "grit/webkit_resources.h" 61 #include "grit/webkit_resources.h"
60 #include "views/controls/single_split_view.h" 62 #include "views/controls/single_split_view.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 } 1122 }
1121 1123
1122 void BrowserView::ShowPageMenu() { 1124 void BrowserView::ShowPageMenu() {
1123 toolbar_->page_menu()->Activate(); 1125 toolbar_->page_menu()->Activate();
1124 } 1126 }
1125 1127
1126 void BrowserView::ShowAppMenu() { 1128 void BrowserView::ShowAppMenu() {
1127 toolbar_->app_menu()->Activate(); 1129 toolbar_->app_menu()->Activate();
1128 } 1130 }
1129 1131
1132 int BrowserView::GetCommandId(const NativeWebKeyboardEvent& event) {
1133 views::Accelerator accelerator(
1134 win_util::WinToKeyboardCode(event.windowsKeyCode),
1135 (event.modifiers & NativeWebKeyboardEvent::ShiftKey) ==
1136 NativeWebKeyboardEvent::ShiftKey,
1137 (event.modifiers & NativeWebKeyboardEvent::ControlKey) ==
1138 NativeWebKeyboardEvent::ControlKey,
1139 (event.modifiers & NativeWebKeyboardEvent::AltKey) ==
1140 NativeWebKeyboardEvent::AltKey);
1141
1142 std::map<views::Accelerator, int>::const_iterator iter =
1143 accelerator_table_.find(accelerator);
1144 if (iter == accelerator_table_.end())
1145 return -1;
1146
1147 return iter->second;
1148 }
1149
1130 /////////////////////////////////////////////////////////////////////////////// 1150 ///////////////////////////////////////////////////////////////////////////////
1131 // BrowserView, BrowserWindowTesting implementation: 1151 // BrowserView, BrowserWindowTesting implementation:
1132 1152
1133 BookmarkBarView* BrowserView::GetBookmarkBarView() const { 1153 BookmarkBarView* BrowserView::GetBookmarkBarView() const {
1134 return bookmark_bar_view_.get(); 1154 return bookmark_bar_view_.get();
1135 } 1155 }
1136 1156
1137 LocationBarView* BrowserView::GetLocationBarView() const { 1157 LocationBarView* BrowserView::GetLocationBarView() const {
1138 return toolbar_->location_bar(); 1158 return toolbar_->location_bar();
1139 } 1159 }
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 2188
2169 // static 2189 // static
2170 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2190 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2171 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2191 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2172 } 2192 }
2173 2193
2174 // static 2194 // static
2175 void BrowserList::AllBrowsersClosed() { 2195 void BrowserList::AllBrowsersClosed() {
2176 views::Window::CloseAllSecondaryWindows(); 2196 views::Window::CloseAllSecondaryWindows();
2177 } 2197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698