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

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

Issue 6487002: Add a new constructor to KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
« no previous file with comments | « chrome/browser/ui/views/find_bar_host_win.cc ('k') | views/controls/button/custom_button.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 views::FocusManager* focus_manager = GetFocusManager(); 1250 views::FocusManager* focus_manager = GetFocusManager();
1251 DCHECK(focus_manager); 1251 DCHECK(focus_manager);
1252 1252
1253 #if defined(OS_LINUX) && !defined(TOUCH_UI) 1253 #if defined(OS_LINUX) && !defined(TOUCH_UI)
1254 // Views and WebKit use different tables for GdkEventKey -> views::KeyEvent 1254 // Views and WebKit use different tables for GdkEventKey -> views::KeyEvent
1255 // conversion. We need to use View's conversion table here to keep consistent 1255 // conversion. We need to use View's conversion table here to keep consistent
1256 // behavior with views::FocusManager::OnKeyEvent() method. 1256 // behavior with views::FocusManager::OnKeyEvent() method.
1257 // TODO(suzhe): We need to check if Windows code also has this issue, and 1257 // TODO(suzhe): We need to check if Windows code also has this issue, and
1258 // it'll be best if we can unify these conversion tables. 1258 // it'll be best if we can unify these conversion tables.
1259 // See http://crbug.com/54315 1259 // See http://crbug.com/54315
1260 views::KeyEvent views_event(event.os_event); 1260 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event));
1261 views::Accelerator accelerator(views_event.key_code(), 1261 views::Accelerator accelerator(views_event.key_code(),
1262 views_event.IsShiftDown(), 1262 views_event.IsShiftDown(),
1263 views_event.IsControlDown(), 1263 views_event.IsControlDown(),
1264 views_event.IsAltDown()); 1264 views_event.IsAltDown());
1265 #else 1265 #else
1266 views::Accelerator accelerator( 1266 views::Accelerator accelerator(
1267 static_cast<ui::KeyboardCode>(event.windowsKeyCode), 1267 static_cast<ui::KeyboardCode>(event.windowsKeyCode),
1268 (event.modifiers & NativeWebKeyboardEvent::ShiftKey) == 1268 (event.modifiers & NativeWebKeyboardEvent::ShiftKey) ==
1269 NativeWebKeyboardEvent::ShiftKey, 1269 NativeWebKeyboardEvent::ShiftKey,
1270 (event.modifiers & NativeWebKeyboardEvent::ControlKey) == 1270 (event.modifiers & NativeWebKeyboardEvent::ControlKey) ==
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2571 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2572 2572
2573 return view; 2573 return view;
2574 } 2574 }
2575 #endif 2575 #endif
2576 2576
2577 // static 2577 // static
2578 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2578 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2579 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2579 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2580 } 2580 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_host_win.cc ('k') | views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698