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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm

Issue 1645503002: Remove dangling ManagePasswordsBubbleModel pointers. Test that different password bubbles don't pin… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <algorithm> 5 #include <algorithm>
6 6
7 #import "chrome/browser/ui/cocoa/passwords/pending_password_view_controller.h" 7 #import "chrome/browser/ui/cocoa/passwords/pending_password_view_controller.h"
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 10 matching lines...) Expand all
21 const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64); 21 const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64);
22 22
23 @implementation PendingPasswordViewController 23 @implementation PendingPasswordViewController
24 24
25 - (BOOL)textView:(NSTextView*)textView 25 - (BOOL)textView:(NSTextView*)textView
26 clickedOnLink:(id)link 26 clickedOnLink:(id)link
27 atIndex:(NSUInteger)charIndex { 27 atIndex:(NSUInteger)charIndex {
28 ManagePasswordsBubbleModel* model = [self model]; 28 ManagePasswordsBubbleModel* model = [self model];
29 if (model) 29 if (model)
30 model->OnBrandLinkClicked(); 30 model->OnBrandLinkClicked();
31 [delegate_ viewShouldDismiss]; 31 [self.delegate viewShouldDismiss];
32 return YES; 32 return YES;
33 } 33 }
34 34
35 - (base::scoped_nsobject<NSButton>)newCloseButton { 35 - (base::scoped_nsobject<NSButton>)newCloseButton {
36 const int dimension = chrome_style::GetCloseButtonSize(); 36 const int dimension = chrome_style::GetCloseButtonSize();
37 NSRect frame = NSMakeRect(0, 0, dimension, dimension); 37 NSRect frame = NSMakeRect(0, 0, dimension, dimension);
38 base::scoped_nsobject<NSButton> button( 38 base::scoped_nsobject<NSButton> button(
39 [[WebUIHoverCloseButton alloc] initWithFrame:frame]); 39 [[WebUIHoverCloseButton alloc] initWithFrame:frame]);
40 [button setAction:@selector(viewShouldDismiss)]; 40 [button setAction:@selector(viewShouldDismiss)];
41 [button setTarget:delegate_]; 41 [button setTarget:self.delegate];
42 return button; 42 return button;
43 } 43 }
44 44
45 - (NSView*)createPasswordView { 45 - (NSView*)createPasswordView {
46 // Empty implementation, it should be implemented in child class. 46 // Empty implementation, it should be implemented in child class.
47 NOTREACHED(); 47 NOTREACHED();
48 return nil; 48 return nil;
49 } 49 }
50 50
51 - (BOOL)shouldShowGoogleSmartLockWelcome { 51 - (BOOL)shouldShowGoogleSmartLockWelcome {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 [closeButton_ setFrameOrigin:closeButtonOrigin]; 165 [closeButton_ setFrameOrigin:closeButtonOrigin];
166 166
167 // Update the bubble size. 167 // Update the bubble size.
168 168
169 [view setFrame:NSMakeRect(0, 0, width, height)]; 169 [view setFrame:NSMakeRect(0, 0, width, height)];
170 170
171 [self setView:view]; 171 [self setView:view];
172 } 172 }
173 173
174 - (ManagePasswordsBubbleModel*)model { 174 - (ManagePasswordsBubbleModel*)model {
175 return [delegate_ model]; 175 return [self.delegate model];
176 } 176 }
177 177
178 @end 178 @end
179 179
180 @implementation PendingPasswordViewController (Testing) 180 @implementation PendingPasswordViewController (Testing)
181 181
182 - (NSButton*)closeButton { 182 - (NSButton*)closeButton {
183 return closeButton_.get(); 183 return closeButton_.get();
184 } 184 }
185 185
186 @end 186 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698