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/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 33 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
34 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 34 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
35 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" | 35 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" |
36 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 36 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
37 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 37 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
38 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 38 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
39 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 39 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
40 #include "chrome/browser/ui/cocoa/key_equivalent_constants.h" | 40 #include "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
41 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 41 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
42 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" | 42 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" |
43 #import "chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller.h" | 43 #import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h" |
44 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" | 44 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" |
45 #include "chrome/browser/ui/cocoa/restart_browser.h" | 45 #include "chrome/browser/ui/cocoa/restart_browser.h" |
46 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" | 46 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" |
47 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 47 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
48 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 48 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
49 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | 49 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
50 #include "chrome/browser/ui/profile_chooser_constants.h" | 50 #include "chrome/browser/ui/profile_chooser_constants.h" |
51 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 51 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
52 #include "chrome/browser/web_applications/web_app.h" | 52 #include "chrome/browser/web_applications/web_app.h" |
53 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const { | 429 bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const { |
430 // On Mac, fullscreen mode has most normal things (in a slide-down panel). | 430 // On Mac, fullscreen mode has most normal things (in a slide-down panel). |
431 return false; | 431 return false; |
432 } | 432 } |
433 | 433 |
434 bool BrowserWindowCocoa::IsFullscreen() const { | 434 bool BrowserWindowCocoa::IsFullscreen() const { |
435 return [controller_ isInAnyFullscreenMode]; | 435 return [controller_ isInAnyFullscreenMode]; |
436 } | 436 } |
437 | 437 |
438 bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const { | 438 bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const { |
439 return false; // Currently only called from toolkit-views website_settings. | 439 return false; // Currently only called from toolkit-views page_info. |
440 } | 440 } |
441 | 441 |
442 void BrowserWindowCocoa::MaybeShowNewBackShortcutBubble(bool forward) { | 442 void BrowserWindowCocoa::MaybeShowNewBackShortcutBubble(bool forward) { |
443 [controller_ exclusiveAccessController]->MaybeShowNewBackShortcutBubble( | 443 [controller_ exclusiveAccessController]->MaybeShowNewBackShortcutBubble( |
444 forward); | 444 forward); |
445 } | 445 } |
446 | 446 |
447 void BrowserWindowCocoa::HideNewBackShortcutBubble() { | 447 void BrowserWindowCocoa::HideNewBackShortcutBubble() { |
448 [controller_ exclusiveAccessController]->HideNewBackShortcutBubble(); | 448 [controller_ exclusiveAccessController]->HideNewBackShortcutBubble(); |
449 } | 449 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 675 } |
676 | 676 |
677 void BrowserWindowCocoa::UserChangedTheme() { | 677 void BrowserWindowCocoa::UserChangedTheme() { |
678 [controller_ userChangedTheme]; | 678 [controller_ userChangedTheme]; |
679 LocationBarViewMac* locationBar = [controller_ locationBarBridge]; | 679 LocationBarViewMac* locationBar = [controller_ locationBarBridge]; |
680 if (locationBar) { | 680 if (locationBar) { |
681 locationBar->OnThemeChanged(); | 681 locationBar->OnThemeChanged(); |
682 } | 682 } |
683 } | 683 } |
684 | 684 |
685 void BrowserWindowCocoa::ShowWebsiteSettings( | 685 void BrowserWindowCocoa::ShowPageInfo( |
686 Profile* profile, | 686 Profile* profile, |
687 content::WebContents* web_contents, | 687 content::WebContents* web_contents, |
688 const GURL& virtual_url, | 688 const GURL& virtual_url, |
689 const security_state::SecurityInfo& security_info) { | 689 const security_state::SecurityInfo& security_info) { |
690 WebsiteSettingsUIBridge::Show(window(), profile, web_contents, virtual_url, | 690 PageInfoUIBridge::Show(window(), profile, web_contents, virtual_url, |
691 security_info); | 691 security_info); |
692 } | 692 } |
693 | 693 |
694 void BrowserWindowCocoa::ShowAppMenu() { | 694 void BrowserWindowCocoa::ShowAppMenu() { |
695 // No-op. Mac doesn't support showing the menus via alt keys. | 695 // No-op. Mac doesn't support showing the menus via alt keys. |
696 } | 696 } |
697 | 697 |
698 content::KeyboardEventProcessingResult | 698 content::KeyboardEventProcessingResult |
699 BrowserWindowCocoa::PreHandleKeyboardEvent( | 699 BrowserWindowCocoa::PreHandleKeyboardEvent( |
700 const NativeWebKeyboardEvent& event) { | 700 const NativeWebKeyboardEvent& event) { |
701 // Handle ESC to dismiss permission bubbles, but still forward it | 701 // Handle ESC to dismiss permission bubbles, but still forward it |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { | 840 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { |
841 return [controller_ exclusiveAccessController]; | 841 return [controller_ exclusiveAccessController]; |
842 } | 842 } |
843 | 843 |
844 void BrowserWindowCocoa::ShowImeWarningBubble( | 844 void BrowserWindowCocoa::ShowImeWarningBubble( |
845 const extensions::Extension* extension, | 845 const extensions::Extension* extension, |
846 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& | 846 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& |
847 callback) { | 847 callback) { |
848 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; | 848 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; |
849 } | 849 } |
OLD | NEW |