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/panels/panel_browser_window_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window_cocoa.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_command_controller.h" |
9 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
10 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 11 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
11 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 12 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
12 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 13 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
13 #include "chrome/browser/ui/panels/panel.h" | 14 #include "chrome/browser/ui/panels/panel.h" |
14 #include "chrome/browser/ui/panels/panel_manager.h" | 15 #include "chrome/browser/ui/panels/panel_manager.h" |
15 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" | 16 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" |
16 #import "chrome/browser/ui/panels/panel_utils_cocoa.h" | 17 #import "chrome/browser/ui/panels/panel_utils_cocoa.h" |
17 #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" | 18 #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 242 |
242 bool PanelBrowserWindowCocoa::PreHandlePanelKeyboardEvent( | 243 bool PanelBrowserWindowCocoa::PreHandlePanelKeyboardEvent( |
243 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 244 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
244 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) | 245 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) |
245 return false; | 246 return false; |
246 | 247 |
247 int id = [BrowserWindowUtils getCommandId:event]; | 248 int id = [BrowserWindowUtils getCommandId:event]; |
248 if (id == -1) | 249 if (id == -1) |
249 return false; | 250 return false; |
250 | 251 |
251 if (GetPanelBrowser()->IsReservedCommandOrKey(id, event)) { | 252 if (GetPanelBrowser()->command_controller()->IsReservedCommandOrKey(id, |
| 253 event)) { |
252 return [BrowserWindowUtils handleKeyboardEvent:event.os_event | 254 return [BrowserWindowUtils handleKeyboardEvent:event.os_event |
253 inWindow:GetNativePanelHandle()]; | 255 inWindow:GetNativePanelHandle()]; |
254 } | 256 } |
255 | 257 |
256 DCHECK(is_keyboard_shortcut); | 258 DCHECK(is_keyboard_shortcut); |
257 *is_keyboard_shortcut = true; | 259 *is_keyboard_shortcut = true; |
258 return false; | 260 return false; |
259 } | 261 } |
260 | 262 |
261 void PanelBrowserWindowCocoa::HandlePanelKeyboardEvent( | 263 void PanelBrowserWindowCocoa::HandlePanelKeyboardEvent( |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 return ![[titlebar() closeButton] isHidden]; | 446 return ![[titlebar() closeButton] isHidden]; |
445 case panel::MINIMIZE_BUTTON: | 447 case panel::MINIMIZE_BUTTON: |
446 return ![[titlebar() minimizeButton] isHidden]; | 448 return ![[titlebar() minimizeButton] isHidden]; |
447 case panel::RESTORE_BUTTON: | 449 case panel::RESTORE_BUTTON: |
448 return ![[titlebar() restoreButton] isHidden]; | 450 return ![[titlebar() restoreButton] isHidden]; |
449 default: | 451 default: |
450 NOTREACHED(); | 452 NOTREACHED(); |
451 } | 453 } |
452 return false; | 454 return false; |
453 } | 455 } |
OLD | NEW |