| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/passwords/autosignin_prompt_view_controller.h" | 5 #import "chrome/browser/ui/cocoa/passwords/autosignin_prompt_view_controller.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" | 12 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
| 13 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h" | 13 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h" |
| 14 #include "chrome/browser/ui/passwords/password_dialog_controller.h" | 14 #include "chrome/browser/ui/passwords/password_dialog_controller.h" |
| 15 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" | 15 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" |
| 16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 17 #include "ui/base/cocoa/controls/hyperlink_text_view.h" | 17 #include "ui/base/cocoa/controls/hyperlink_text_view.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 namespace { | |
| 21 | |
| 22 // Returns a NSRegularControlSize button. It's used for improving the contrast | |
| 23 // due to Accessabilty standards. | |
| 24 NSButton* BiggerDialogButton(NSString* title) { | |
| 25 base::scoped_nsobject<NSButton> button( | |
| 26 [[NSButton alloc] initWithFrame:NSZeroRect]); | |
| 27 CGFloat fontSize = [NSFont systemFontSizeForControlSize:NSRegularControlSize]; | |
| 28 [button setFont:[NSFont systemFontOfSize:fontSize]]; | |
| 29 [button setTitle:title]; | |
| 30 [button setBezelStyle:NSRoundedBezelStyle]; | |
| 31 [[button cell] setControlSize:NSRegularControlSize]; | |
| 32 [button sizeToFit]; | |
| 33 return button.autorelease(); | |
| 34 } | |
| 35 | |
| 36 } // namespace | |
| 37 | |
| 38 @interface AutoSigninPromptView : NSView | 20 @interface AutoSigninPromptView : NSView |
| 39 @property (nonatomic, copy) BOOL (^escHandler)(NSEvent* theEvent); | 21 @property (nonatomic, copy) BOOL (^escHandler)(NSEvent* theEvent); |
| 40 @end | 22 @end |
| 41 | 23 |
| 42 @implementation AutoSigninPromptView | 24 @implementation AutoSigninPromptView |
| 43 @synthesize escHandler = _escHandler; | 25 @synthesize escHandler = _escHandler; |
| 44 | 26 |
| 45 -(void)dealloc { | 27 -(void)dealloc { |
| 46 [_escHandler release]; | 28 [_escHandler release]; |
| 47 [super dealloc]; | 29 [super dealloc]; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 179 } |
| 198 | 180 |
| 199 - (NSButton*)okButton { | 181 - (NSButton*)okButton { |
| 200 return _okButton; | 182 return _okButton; |
| 201 } | 183 } |
| 202 | 184 |
| 203 - (NSButton*)turnOffButton { | 185 - (NSButton*)turnOffButton { |
| 204 return _turnOffButton; | 186 return _turnOffButton; |
| 205 } | 187 } |
| 206 @end | 188 @end |
| OLD | NEW |