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

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

Issue 3046041: [Linux Views] Refactor accelerator handler related code. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Prevent ctrl+alt. Created 10 years, 4 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "views/window/dialog_delegate.h" 66 #include "views/window/dialog_delegate.h"
67 #include "views/window/window.h" 67 #include "views/window/window.h"
68 68
69 #if defined(OS_WIN) 69 #if defined(OS_WIN)
70 #include "app/win_util.h" 70 #include "app/win_util.h"
71 #include "chrome/browser/aeropeek_manager.h" 71 #include "chrome/browser/aeropeek_manager.h"
72 #include "chrome/browser/jumplist_win.h" 72 #include "chrome/browser/jumplist_win.h"
73 #elif defined(OS_LINUX) 73 #elif defined(OS_LINUX)
74 #include "chrome/browser/views/accelerator_table_gtk.h" 74 #include "chrome/browser/views/accelerator_table_gtk.h"
75 #include "views/window/hit_test.h" 75 #include "views/window/hit_test.h"
76 #include "views/window/window_gtk.h"
76 #endif 77 #endif
77 78
78 using base::TimeDelta; 79 using base::TimeDelta;
79 using views::ColumnSet; 80 using views::ColumnSet;
80 using views::GridLayout; 81 using views::GridLayout;
81 82
82 // The height of the status bubble. 83 // The height of the status bubble.
83 static const int kStatusBubbleHeight = 20; 84 static const int kStatusBubbleHeight = 20;
84 // The name of a key to store on the window handle so that other code can 85 // The name of a key to store on the window handle so that other code can
85 // locate this object using just the handle. 86 // locate this object using just the handle.
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 return true; 1232 return true;
1232 } 1233 }
1233 1234
1234 DCHECK(is_keyboard_shortcut != NULL); 1235 DCHECK(is_keyboard_shortcut != NULL);
1235 *is_keyboard_shortcut = true; 1236 *is_keyboard_shortcut = true;
1236 1237
1237 return false; 1238 return false;
1238 } 1239 }
1239 1240
1240 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { 1241 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
1242 #if defined(OS_LINUX)
1243 views::Window* window = GetWidget()->GetWindow();
1244 if (window && event.os_event && !event.skip_in_browser)
1245 static_cast<views::WindowGtk*>(window)->HandleKeyboardEvent(event.os_event);
1246 #else
1241 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, 1247 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event,
1242 GetFocusManager()); 1248 GetFocusManager());
1249 #endif
1243 } 1250 }
1244 1251
1245 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always 1252 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always
1246 // enabled in the page menu regardless of whether the command will do 1253 // enabled in the page menu regardless of whether the command will do
1247 // anything. When someone selects the menu item, we just act as if they hit 1254 // anything. When someone selects the menu item, we just act as if they hit
1248 // the keyboard shortcut for the command by sending the associated key press 1255 // the keyboard shortcut for the command by sending the associated key press
1249 // to windows. The real fix to this bug is to disable the commands when they 1256 // to windows. The real fix to this bug is to disable the commands when they
1250 // won't do anything. We'll need something like an overall clipboard command 1257 // won't do anything. We'll need something like an overall clipboard command
1251 // manager to do that. 1258 // manager to do that.
1252 #if !defined(OS_MACOSX) 1259 #if !defined(OS_MACOSX)
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); 2246 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
2240 2247
2241 return view; 2248 return view;
2242 } 2249 }
2243 #endif 2250 #endif
2244 2251
2245 // static 2252 // static
2246 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2253 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2247 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2254 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2248 } 2255 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698