Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h"
6 6
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 8 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
9 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 9 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
10 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h" 10 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h"
(...skipping 26 matching lines...) Expand all
37 37
38 // Set the anchor point to right below the wrench menu. 38 // Set the anchor point to right below the wrench menu.
39 NSView* wrenchButton = [[controller toolbarController] wrenchButton]; 39 NSView* wrenchButton = [[controller toolbarController] wrenchButton];
40 const NSRect bounds = [wrenchButton bounds]; 40 const NSRect bounds = [wrenchButton bounds];
41 NSPoint anchorPoint = NSMakePoint(NSMidX(bounds), NSMaxY(bounds)); 41 NSPoint anchorPoint = NSMakePoint(NSMidX(bounds), NSMaxY(bounds));
42 anchorPoint = [wrenchButton convertPoint:anchorPoint toView:nil]; 42 anchorPoint = [wrenchButton convertPoint:anchorPoint toView:nil];
43 anchorPoint = [parentWindow convertBaseToScreen:anchorPoint]; 43 anchorPoint = [parentWindow convertBaseToScreen:anchorPoint];
44 44
45 // Create an empty window into which content is placed. 45 // Create an empty window into which content is placed.
46 NSRect viewBounds = [[viewController_ view] bounds]; 46 NSRect viewBounds = [[viewController_ view] bounds];
47 scoped_nsobject<InfoBubbleWindow> window( 47 base::scoped_nsobject<InfoBubbleWindow> window(
48 [[InfoBubbleWindow alloc] initWithContentRect:viewBounds 48 [[InfoBubbleWindow alloc] initWithContentRect:viewBounds
49 styleMask:NSBorderlessWindowMask 49 styleMask:NSBorderlessWindowMask
50 backing:NSBackingStoreBuffered 50 backing:NSBackingStoreBuffered
51 defer:NO]); 51 defer:NO]);
52 if (self = [super initWithWindow:window 52 if (self = [super initWithWindow:window
53 parentWindow:parentWindow 53 parentWindow:parentWindow
54 anchoredAt:anchorPoint]) { 54 anchoredAt:anchorPoint]) {
55 [[window contentView] addSubview:[viewController_ view]]; 55 [[window contentView] addSubview:[viewController_ view]];
56 // This class will release itself when the bubble closes. See 56 // This class will release itself when the bubble closes. See
57 // -[BaseBubbleController windowWillClose:]. 57 // -[BaseBubbleController windowWillClose:].
58 [self retain]; 58 [self retain];
59 } 59 }
60 60
61 return self; 61 return self;
62 } 62 }
63 63
64 - (OneClickSigninViewController*)viewController { 64 - (OneClickSigninViewController*)viewController {
65 return viewController_; 65 return viewController_;
66 } 66 }
67 67
68 - (void)windowWillClose:(NSNotification*)notification { 68 - (void)windowWillClose:(NSNotification*)notification {
69 [viewController_ viewWillClose]; 69 [viewController_ viewWillClose];
70 [super windowWillClose:notification]; 70 [super windowWillClose:notification];
71 } 71 }
72 72
73 @end // OneClickSigninBubbleController 73 @end // OneClickSigninBubbleController
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698