| 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 #import "chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
" | 5 #import "chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/password_manager/password_manager.h" | 9 #include "chrome/browser/password_manager/password_manager.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 - (NSRect)adjustFrameForFrame:(NSRect)frame { | 214 - (NSRect)adjustFrameForFrame:(NSRect)frame { |
| 215 // By default, there appears to be a 2 pixel gap between what is considered | 215 // By default, there appears to be a 2 pixel gap between what is considered |
| 216 // part of the textFrame and what is considered part of the icon. | 216 // part of the textFrame and what is considered part of the icon. |
| 217 // TODO(gcasto): This really should be fixed in StyledTextFieldCell, as it | 217 // TODO(gcasto): This really should be fixed in StyledTextFieldCell, as it |
| 218 // looks like the location bar also suffers from this issue. | 218 // looks like the location bar also suffers from this issue. |
| 219 frame.size.width += 2; | 219 frame.size.width += 2; |
| 220 return frame; | 220 return frame; |
| 221 } | 221 } |
| 222 | 222 |
| 223 - (NSRect)textFrameForFrame:(NSRect)cellFrame { | 223 - (NSRect)textFrameForFrame:(NSRect)cellFrame { |
| 224 // Baseclass insets the rect by baselineAdjust. | 224 // Baseclass insets the rect by top and bottom offsets. |
| 225 NSRect textFrame = [super textFrameForFrame:cellFrame]; | 225 NSRect textFrame = [super textFrameForFrame:cellFrame]; |
| 226 textFrame = [self getTextFrame:textFrame]; | 226 textFrame = [self getTextFrame:textFrame]; |
| 227 return [self adjustFrameForFrame:textFrame]; | 227 return [self adjustFrameForFrame:textFrame]; |
| 228 } | 228 } |
| 229 | 229 |
| 230 - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame { | 230 - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame { |
| 231 NSRect textFrame = [self getTextFrame:cellFrame]; | 231 NSRect textFrame = [self getTextFrame:cellFrame]; |
| 232 return [self adjustFrameForFrame:textFrame]; | 232 return [self adjustFrameForFrame:textFrame]; |
| 233 } | 233 } |
| 234 | 234 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 262 NSRect iconFrame = [self getIconFrame:frame]; | 262 NSRect iconFrame = [self getIconFrame:frame]; |
| 263 scoped_nsobject<CrTrackingArea> area( | 263 scoped_nsobject<CrTrackingArea> area( |
| 264 [[CrTrackingArea alloc] initWithRect:iconFrame | 264 [[CrTrackingArea alloc] initWithRect:iconFrame |
| 265 options:NSTrackingMouseEnteredAndExited | | 265 options:NSTrackingMouseEnteredAndExited | |
| 266 NSTrackingActiveAlways | 266 NSTrackingActiveAlways |
| 267 owner:view | 267 owner:view |
| 268 userInfo:nil]); | 268 userInfo:nil]); |
| 269 [view addTrackingArea:area]; | 269 [view addTrackingArea:area]; |
| 270 } | 270 } |
| 271 | 271 |
| 272 - (CGFloat)baselineAdjust { | 272 - (CGFloat)topTextFrameOffset { |
| 273 return 1.0; | 273 return 1.0; |
| 274 } | 274 } |
| 275 | 275 |
| 276 - (CGFloat)bottomTextFrameOffset { |
| 277 return 1.0; |
| 278 } |
| 279 |
| 276 - (CGFloat)cornerRadius { | 280 - (CGFloat)cornerRadius { |
| 277 return 4.0; | 281 return 4.0; |
| 278 } | 282 } |
| 279 | 283 |
| 280 - (BOOL)shouldDrawBezel { | 284 - (BOOL)shouldDrawBezel { |
| 281 return YES; | 285 return YES; |
| 282 } | 286 } |
| 283 | 287 |
| 284 @end | 288 @end |
| 285 | 289 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 - (void)controlTextDidChange:(NSNotification*)notification { | 400 - (void)controlTextDidChange:(NSNotification*)notification { |
| 397 actions_.password_edited = true; | 401 actions_.password_edited = true; |
| 398 } | 402 } |
| 399 | 403 |
| 400 - (void)windowWillClose:(NSNotification*)notification { | 404 - (void)windowWillClose:(NSNotification*)notification { |
| 401 autofill::password_generation::LogUserActions(actions_); | 405 autofill::password_generation::LogUserActions(actions_); |
| 402 [super windowWillClose:notification]; | 406 [super windowWillClose:notification]; |
| 403 } | 407 } |
| 404 | 408 |
| 405 @end | 409 @end |
| OLD | NEW |