| 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 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 703 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
| 704 [menu showWindow:nil]; | 704 [menu showWindow:nil]; |
| 705 } | 705 } |
| 706 | 706 |
| 707 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton( | 707 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton( |
| 708 AvatarBubbleMode mode, signin::GAIAServiceType service_type) { | 708 AvatarBubbleMode mode, signin::GAIAServiceType service_type) { |
| 709 AvatarBaseController* controller = [controller_ avatarButtonController]; | 709 AvatarBaseController* controller = [controller_ avatarButtonController]; |
| 710 NSView* anchor = [controller buttonView]; | 710 NSView* anchor = [controller buttonView]; |
| 711 if ([anchor isHiddenOrHasHiddenAncestor]) | 711 if ([anchor isHiddenOrHasHiddenAncestor]) |
| 712 anchor = [[controller_ toolbarController] wrenchButton]; | 712 anchor = [[controller_ toolbarController] wrenchButton]; |
| 713 // TODO(mlerman): pass |service_type| to profile_chooser_controller to | 713 [controller showAvatarBubble:anchor |
| 714 // implement UMA instrumentation of the menu. | 714 withMode:mode |
| 715 [controller showAvatarBubble:anchor withMode:mode]; | 715 withServiceType:service_type]; |
| 716 } | 716 } |
| 717 | 717 |
| 718 void BrowserWindowCocoa::ShowPasswordGenerationBubble( | 718 void BrowserWindowCocoa::ShowPasswordGenerationBubble( |
| 719 const gfx::Rect& rect, | 719 const gfx::Rect& rect, |
| 720 const autofill::PasswordForm& form, | 720 const autofill::PasswordForm& form, |
| 721 autofill::PasswordGenerator* password_generator) { | 721 autofill::PasswordGenerator* password_generator) { |
| 722 WebContents* web_contents = | 722 WebContents* web_contents = |
| 723 browser_->tab_strip_model()->GetActiveWebContents(); | 723 browser_->tab_strip_model()->GetActiveWebContents(); |
| 724 // We want to point to the middle of the rect instead of the right side. | 724 // We want to point to the middle of the rect instead of the right side. |
| 725 NSPoint point = GetPointForBubble(web_contents, | 725 NSPoint point = GetPointForBubble(web_contents, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 753 | 753 |
| 754 void BrowserWindowCocoa::ShowPageActionPopup( | 754 void BrowserWindowCocoa::ShowPageActionPopup( |
| 755 const extensions::Extension* extension) { | 755 const extensions::Extension* extension) { |
| 756 [cocoa_controller() activatePageAction:extension->id()]; | 756 [cocoa_controller() activatePageAction:extension->id()]; |
| 757 } | 757 } |
| 758 | 758 |
| 759 void BrowserWindowCocoa::ShowBrowserActionPopup( | 759 void BrowserWindowCocoa::ShowBrowserActionPopup( |
| 760 const extensions::Extension* extension) { | 760 const extensions::Extension* extension) { |
| 761 [cocoa_controller() activateBrowserAction:extension->id()]; | 761 [cocoa_controller() activateBrowserAction:extension->id()]; |
| 762 } | 762 } |
| OLD | NEW |