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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 NSWindow* BrowserWindowCocoa::window() const { | 814 NSWindow* BrowserWindowCocoa::window() const { |
815 return [controller_ window]; | 815 return [controller_ window]; |
816 } | 816 } |
817 | 817 |
818 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton( | 818 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton( |
819 AvatarBubbleMode mode, | 819 AvatarBubbleMode mode, |
820 const signin::ManageAccountsParams& manage_accounts_params, | 820 const signin::ManageAccountsParams& manage_accounts_params, |
821 signin_metrics::AccessPoint access_point, | 821 signin_metrics::AccessPoint access_point, |
822 bool is_source_keyboard) { | 822 bool is_source_keyboard) { |
823 profiles::BubbleViewMode bubble_view_mode; | 823 profiles::BubbleViewMode bubble_view_mode; |
824 profiles::TutorialMode tutorial_mode; | 824 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode); |
825 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, | |
826 &tutorial_mode); | |
827 | 825 |
828 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { | 826 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { |
829 browser_->signin_view_controller()->ShowModalSignin(bubble_view_mode, | 827 browser_->signin_view_controller()->ShowModalSignin(bubble_view_mode, |
830 browser_, access_point); | 828 browser_, access_point); |
831 } else { | 829 } else { |
832 AvatarBaseController* controller = [controller_ avatarButtonController]; | 830 AvatarBaseController* controller = [controller_ avatarButtonController]; |
833 NSView* anchor = [controller buttonView]; | 831 NSView* anchor = [controller buttonView]; |
834 if ([anchor isHiddenOrHasHiddenAncestor]) | 832 if ([anchor isHiddenOrHasHiddenAncestor]) |
835 anchor = [[controller_ toolbarController] appMenuButton]; | 833 anchor = [[controller_ toolbarController] appMenuButton]; |
836 [controller showAvatarBubbleAnchoredAt:anchor | 834 [controller showAvatarBubbleAnchoredAt:anchor |
(...skipping 19 matching lines...) Expand all Loading... |
856 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { | 854 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { |
857 return [controller_ exclusiveAccessController]; | 855 return [controller_ exclusiveAccessController]; |
858 } | 856 } |
859 | 857 |
860 void BrowserWindowCocoa::ShowImeWarningBubble( | 858 void BrowserWindowCocoa::ShowImeWarningBubble( |
861 const extensions::Extension* extension, | 859 const extensions::Extension* extension, |
862 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& | 860 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& |
863 callback) { | 861 callback) { |
864 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; | 862 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; |
865 } | 863 } |
OLD | NEW |