| 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(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 #include "ui/aura_shell/launcher/launcher_model.h" | 114 #include "ui/aura_shell/launcher/launcher_model.h" |
| 115 #include "ui/aura_shell/shell.h" | 115 #include "ui/aura_shell/shell.h" |
| 116 #include "ui/gfx/screen.h" | 116 #include "ui/gfx/screen.h" |
| 117 #elif defined(OS_WIN) | 117 #elif defined(OS_WIN) |
| 118 #include "chrome/browser/aeropeek_manager.h" | 118 #include "chrome/browser/aeropeek_manager.h" |
| 119 #include "chrome/browser/jumplist_win.h" | 119 #include "chrome/browser/jumplist_win.h" |
| 120 #include "ui/base/message_box_win.h" | 120 #include "ui/base/message_box_win.h" |
| 121 #include "ui/views/widget/native_widget_win.h" | 121 #include "ui/views/widget/native_widget_win.h" |
| 122 #elif defined(TOOLKIT_USES_GTK) | 122 #elif defined(TOOLKIT_USES_GTK) |
| 123 #include "chrome/browser/ui/views/accelerator_table.h" | 123 #include "chrome/browser/ui/views/accelerator_table.h" |
| 124 #include "chrome/browser/ui/views/handle_web_keyboard_event.h" | |
| 125 #endif | 124 #endif |
| 126 | 125 |
| 127 #if defined(OS_CHROMEOS) | 126 #if defined(OS_CHROMEOS) |
| 128 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" | 127 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" |
| 129 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 128 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 130 #endif | 129 #endif |
| 131 | 130 |
| 132 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 131 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 133 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 132 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
| 134 #endif | 133 #endif |
| (...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 return browser_->ExecuteCommandIfEnabled(id); | 1270 return browser_->ExecuteCommandIfEnabled(id); |
| 1272 } | 1271 } |
| 1273 | 1272 |
| 1274 DCHECK(is_keyboard_shortcut != NULL); | 1273 DCHECK(is_keyboard_shortcut != NULL); |
| 1275 *is_keyboard_shortcut = true; | 1274 *is_keyboard_shortcut = true; |
| 1276 | 1275 |
| 1277 return false; | 1276 return false; |
| 1278 } | 1277 } |
| 1279 | 1278 |
| 1280 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 1279 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 1281 // TODO(ben): figure out why are these two code paths so different | |
| 1282 #if defined(TOOLKIT_USES_GTK) | |
| 1283 HandleWebKeyboardEvent(GetWidget(), event); | |
| 1284 #else | |
| 1285 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 1280 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| 1286 GetFocusManager()); | 1281 GetFocusManager()); |
| 1287 #endif | |
| 1288 } | 1282 } |
| 1289 | 1283 |
| 1290 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always | 1284 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always |
| 1291 // enabled in the page menu regardless of whether the command will do | 1285 // enabled in the page menu regardless of whether the command will do |
| 1292 // anything. When someone selects the menu item, we just act as if they hit | 1286 // anything. When someone selects the menu item, we just act as if they hit |
| 1293 // the keyboard shortcut for the command by sending the associated key press | 1287 // the keyboard shortcut for the command by sending the associated key press |
| 1294 // to windows. The real fix to this bug is to disable the commands when they | 1288 // to windows. The real fix to this bug is to disable the commands when they |
| 1295 // won't do anything. We'll need something like an overall clipboard command | 1289 // won't do anything. We'll need something like an overall clipboard command |
| 1296 // manager to do that. | 1290 // manager to do that. |
| 1297 void BrowserView::Cut() { | 1291 void BrowserView::Cut() { |
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 browser::CreateViewsBubble(bubble); | 2653 browser::CreateViewsBubble(bubble); |
| 2660 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2654 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2661 bubble->Show(); | 2655 bubble->Show(); |
| 2662 } | 2656 } |
| 2663 | 2657 |
| 2664 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2658 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2665 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2659 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2666 if (button) | 2660 if (button) |
| 2667 button->ShowAvatarBubble(); | 2661 button->ShowAvatarBubble(); |
| 2668 } | 2662 } |
| OLD | NEW |