| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" | 115 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" |
| 116 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h" | 116 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h" |
| 117 #include "ui/gfx/screen.h" | 117 #include "ui/gfx/screen.h" |
| 118 #elif defined(OS_WIN) | 118 #elif defined(OS_WIN) |
| 119 #include "chrome/browser/aeropeek_manager.h" | 119 #include "chrome/browser/aeropeek_manager.h" |
| 120 #include "chrome/browser/jumplist_win.h" | 120 #include "chrome/browser/jumplist_win.h" |
| 121 #include "ui/base/message_box_win.h" | 121 #include "ui/base/message_box_win.h" |
| 122 #include "ui/views/widget/native_widget_win.h" | 122 #include "ui/views/widget/native_widget_win.h" |
| 123 #elif defined(TOOLKIT_USES_GTK) | 123 #elif defined(TOOLKIT_USES_GTK) |
| 124 #include "chrome/browser/ui/views/accelerator_table.h" | 124 #include "chrome/browser/ui/views/accelerator_table.h" |
| 125 #include "chrome/browser/ui/views/handle_web_keyboard_event.h" | |
| 126 #endif | 125 #endif |
| 127 | 126 |
| 128 #if defined(OS_CHROMEOS) | 127 #if defined(OS_CHROMEOS) |
| 129 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" | 128 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" |
| 130 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 129 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 131 #endif | 130 #endif |
| 132 | 131 |
| 133 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 132 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 134 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 133 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
| 135 #endif | 134 #endif |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 return browser_->ExecuteCommandIfEnabled(id); | 1277 return browser_->ExecuteCommandIfEnabled(id); |
| 1279 } | 1278 } |
| 1280 | 1279 |
| 1281 DCHECK(is_keyboard_shortcut != NULL); | 1280 DCHECK(is_keyboard_shortcut != NULL); |
| 1282 *is_keyboard_shortcut = true; | 1281 *is_keyboard_shortcut = true; |
| 1283 | 1282 |
| 1284 return false; | 1283 return false; |
| 1285 } | 1284 } |
| 1286 | 1285 |
| 1287 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 1286 void BrowserView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 1288 // TODO(ben): figure out why are these two code paths so different | |
| 1289 #if defined(TOOLKIT_USES_GTK) | |
| 1290 HandleWebKeyboardEvent(GetWidget(), event); | |
| 1291 #else | |
| 1292 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, | 1287 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| 1293 GetFocusManager()); | 1288 GetFocusManager()); |
| 1294 #endif | |
| 1295 } | 1289 } |
| 1296 | 1290 |
| 1297 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always | 1291 // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always |
| 1298 // enabled in the page menu regardless of whether the command will do | 1292 // enabled in the page menu regardless of whether the command will do |
| 1299 // anything. When someone selects the menu item, we just act as if they hit | 1293 // anything. When someone selects the menu item, we just act as if they hit |
| 1300 // the keyboard shortcut for the command by sending the associated key press | 1294 // the keyboard shortcut for the command by sending the associated key press |
| 1301 // to windows. The real fix to this bug is to disable the commands when they | 1295 // to windows. The real fix to this bug is to disable the commands when they |
| 1302 // won't do anything. We'll need something like an overall clipboard command | 1296 // won't do anything. We'll need something like an overall clipboard command |
| 1303 // manager to do that. | 1297 // manager to do that. |
| 1304 void BrowserView::Cut() { | 1298 void BrowserView::Cut() { |
| (...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2679 browser::CreateViewsBubble(bubble); | 2673 browser::CreateViewsBubble(bubble); |
| 2680 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2674 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2681 bubble->Show(); | 2675 bubble->Show(); |
| 2682 } | 2676 } |
| 2683 | 2677 |
| 2684 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2678 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2685 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2679 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2686 if (button) | 2680 if (button) |
| 2687 button->ShowAvatarBubble(); | 2681 button->ShowAvatarBubble(); |
| 2688 } | 2682 } |
| OLD | NEW |