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