| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |