OLD | NEW |
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #include "grit/chromium_strings.h" | 72 #include "grit/chromium_strings.h" |
73 #include "grit/generated_resources.h" | 73 #include "grit/generated_resources.h" |
74 #include "grit/locale_settings.h" | 74 #include "grit/locale_settings.h" |
75 #include "grit/theme_resources.h" | 75 #include "grit/theme_resources.h" |
76 #include "grit/webkit_resources.h" | 76 #include "grit/webkit_resources.h" |
77 #include "ui/base/accessibility/accessible_view_state.h" | 77 #include "ui/base/accessibility/accessible_view_state.h" |
78 #include "ui/base/l10n/l10n_util.h" | 78 #include "ui/base/l10n/l10n_util.h" |
79 #include "ui/base/resource/resource_bundle.h" | 79 #include "ui/base/resource/resource_bundle.h" |
80 #include "ui/gfx/canvas_skia.h" | 80 #include "ui/gfx/canvas_skia.h" |
81 #include "views/controls/single_split_view.h" | 81 #include "views/controls/single_split_view.h" |
| 82 #include "views/events/event.h" |
82 #include "views/focus/external_focus_tracker.h" | 83 #include "views/focus/external_focus_tracker.h" |
83 #include "views/focus/view_storage.h" | 84 #include "views/focus/view_storage.h" |
84 #include "views/layout/grid_layout.h" | 85 #include "views/layout/grid_layout.h" |
85 #include "views/widget/root_view.h" | 86 #include "views/widget/root_view.h" |
86 #include "views/window/dialog_delegate.h" | 87 #include "views/window/dialog_delegate.h" |
87 #include "views/window/window.h" | 88 #include "views/window/window.h" |
88 | 89 |
89 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
90 #include "chrome/browser/aeropeek_manager.h" | 91 #include "chrome/browser/aeropeek_manager.h" |
91 #include "chrome/browser/jumplist_win.h" | 92 #include "chrome/browser/jumplist_win.h" |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 | 1252 |
1252 DCHECK(is_keyboard_shortcut != NULL); | 1253 DCHECK(is_keyboard_shortcut != NULL); |
1253 *is_keyboard_shortcut = true; | 1254 *is_keyboard_shortcut = true; |
1254 | 1255 |
1255 return false; | 1256 return false; |
1256 } | 1257 } |
1257 | 1258 |
1258 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 1259 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
1259 #if defined(OS_LINUX) && !defined(TOUCH_UI) | 1260 #if defined(OS_LINUX) && !defined(TOUCH_UI) |
1260 views::Window* window = GetWidget()->GetWindow(); | 1261 views::Window* window = GetWidget()->GetWindow(); |
1261 if (window && event.os_event && !event.skip_in_browser) | 1262 if (window && event.os_event && !event.skip_in_browser) { |
1262 static_cast<views::WindowGtk*>(window)->HandleKeyboardEvent(event.os_event); | 1263 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); |
| 1264 static_cast<views::WindowGtk*>(window)->HandleKeyboardEvent(views_event); |
| 1265 } |
1263 #else | 1266 #else |
1264 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 1267 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
1265 GetFocusManager()); | 1268 GetFocusManager()); |
1266 #endif | 1269 #endif |
1267 } | 1270 } |
1268 | 1271 |
1269 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always | 1272 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always |
1270 // enabled in the page menu regardless of whether the command will do | 1273 // enabled in the page menu regardless of whether the command will do |
1271 // anything. When someone selects the menu item, we just act as if they hit | 1274 // anything. When someone selects the menu item, we just act as if they hit |
1272 // the keyboard shortcut for the command by sending the associated key press | 1275 // the keyboard shortcut for the command by sending the associated key press |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2568 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2571 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
2569 | 2572 |
2570 return view; | 2573 return view; |
2571 } | 2574 } |
2572 #endif | 2575 #endif |
2573 | 2576 |
2574 // static | 2577 // static |
2575 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 2578 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
2576 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 2579 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
2577 } | 2580 } |
OLD | NEW |