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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "ui/base/l10n/l10n_util_mac.h" | 66 #include "ui/base/l10n/l10n_util_mac.h" |
67 #include "ui/events/keycodes/keyboard_codes.h" | 67 #include "ui/events/keycodes/keyboard_codes.h" |
68 #include "ui/gfx/geometry/rect.h" | 68 #include "ui/gfx/geometry/rect.h" |
69 | 69 |
70 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 70 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
71 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" | 71 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" |
72 #import "chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h" | 72 #import "chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h" |
73 #endif | 73 #endif |
74 | 74 |
75 using content::NativeWebKeyboardEvent; | 75 using content::NativeWebKeyboardEvent; |
76 using content::SSLStatus; | |
77 using content::WebContents; | 76 using content::WebContents; |
78 | 77 |
79 namespace { | 78 namespace { |
80 | 79 |
81 // These UI constants are used in BrowserWindowCocoa::ShowBookmarkAppBubble. | 80 // These UI constants are used in BrowserWindowCocoa::ShowBookmarkAppBubble. |
82 // Used for defining the layout of the NSAlert and NSTextField within the | 81 // Used for defining the layout of the NSAlert and NSTextField within the |
83 // accessory view. | 82 // accessory view. |
84 const int kAppTextFieldVerticalSpacing = 2; | 83 const int kAppTextFieldVerticalSpacing = 2; |
85 const int kAppTextFieldWidth = 200; | 84 const int kAppTextFieldWidth = 200; |
86 const int kAppTextFieldHeight = 22; | 85 const int kAppTextFieldHeight = 22; |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 } | 703 } |
705 | 704 |
706 void BrowserWindowCocoa::UserChangedTheme() { | 705 void BrowserWindowCocoa::UserChangedTheme() { |
707 [controller_ userChangedTheme]; | 706 [controller_ userChangedTheme]; |
708 } | 707 } |
709 | 708 |
710 void BrowserWindowCocoa::ShowWebsiteSettings( | 709 void BrowserWindowCocoa::ShowWebsiteSettings( |
711 Profile* profile, | 710 Profile* profile, |
712 content::WebContents* web_contents, | 711 content::WebContents* web_contents, |
713 const GURL& url, | 712 const GURL& url, |
714 const content::SSLStatus& ssl) { | 713 const SecurityStateModel::SecurityInfo& security_info) { |
715 WebsiteSettingsUIBridge::Show(window(), profile, web_contents, url, ssl); | 714 WebsiteSettingsUIBridge::Show(window(), profile, web_contents, url, |
| 715 security_info); |
716 } | 716 } |
717 | 717 |
718 void BrowserWindowCocoa::ShowAppMenu() { | 718 void BrowserWindowCocoa::ShowAppMenu() { |
719 // No-op. Mac doesn't support showing the menus via alt keys. | 719 // No-op. Mac doesn't support showing the menus via alt keys. |
720 } | 720 } |
721 | 721 |
722 bool BrowserWindowCocoa::PreHandleKeyboardEvent( | 722 bool BrowserWindowCocoa::PreHandleKeyboardEvent( |
723 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 723 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
724 // Handle ESC to dismiss permission bubbles, but still forward it | 724 // Handle ESC to dismiss permission bubbles, but still forward it |
725 // to the window afterwards. | 725 // to the window afterwards. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 void BrowserWindowCocoa::UnhideDownloadShelf() { | 858 void BrowserWindowCocoa::UnhideDownloadShelf() { |
859 GetDownloadShelf()->Unhide(); | 859 GetDownloadShelf()->Unhide(); |
860 } | 860 } |
861 | 861 |
862 void BrowserWindowCocoa::HideDownloadShelf() { | 862 void BrowserWindowCocoa::HideDownloadShelf() { |
863 GetDownloadShelf()->Hide(); | 863 GetDownloadShelf()->Hide(); |
864 StatusBubble* statusBubble = GetStatusBubble(); | 864 StatusBubble* statusBubble = GetStatusBubble(); |
865 if (statusBubble) | 865 if (statusBubble) |
866 statusBubble->Hide(); | 866 statusBubble->Hide(); |
867 } | 867 } |
OLD | NEW |