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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/password_generation_popup_view_bridge.mm

Issue 487193003: Update Mac password generation autofill popup to match latest mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rewrite layout Created 6 years, 4 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_bridge .h" 7 #include "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_bridge .h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h"
11 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h"
12 #include "chrome/browser/ui/autofill/popup_constants.h"
groby-ooo-7-16 2014/08/21 04:40:05 I believe both of these are unnecessary?
dconnelly 2014/08/21 10:44:25 Done.
11 #import "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.h " 13 #import "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.h "
12 #include "ui/base/cocoa/window_size_constants.h" 14 #include "ui/gfx/size.h"
13 #include "ui/gfx/rect.h"
14 15
15 namespace autofill { 16 namespace autofill {
16 17
17 PasswordGenerationPopupViewBridge::PasswordGenerationPopupViewBridge( 18 PasswordGenerationPopupViewBridge::PasswordGenerationPopupViewBridge(
18 PasswordGenerationPopupController* controller) { 19 PasswordGenerationPopupController* controller) {
19 view_.reset( 20 view_.reset(
20 [[PasswordGenerationPopupViewCocoa alloc] 21 [[PasswordGenerationPopupViewCocoa alloc]
21 initWithController:controller 22 initWithController:controller
22 frame:NSZeroRect]); 23 frame:NSZeroRect]);
23 } 24 }
24 25
25 PasswordGenerationPopupViewBridge::~PasswordGenerationPopupViewBridge() { 26 PasswordGenerationPopupViewBridge::~PasswordGenerationPopupViewBridge() {
26 [view_ controllerDestroyed]; 27 [view_ controllerDestroyed];
27 [view_ hidePopup]; 28 [view_ hidePopup];
28 } 29 }
29 30
30 void PasswordGenerationPopupViewBridge::Hide() { 31 void PasswordGenerationPopupViewBridge::Hide() {
31 delete this; 32 delete this;
32 } 33 }
33 34
34 void PasswordGenerationPopupViewBridge::Show() { 35 void PasswordGenerationPopupViewBridge::Show() {
35 [view_ showPopup]; 36 [view_ showPopup];
36 } 37 }
37 38
38 gfx::Size PasswordGenerationPopupViewBridge::GetPreferredSizeOfPasswordView() { 39 gfx::Size PasswordGenerationPopupViewBridge::GetPreferredSizeOfPasswordView() {
39 // TODO(gcasto): Implement this function. 40 return gfx::Size(NSSizeToCGSize([view_ preferredSize]));
40 return gfx::Size();
41 } 41 }
42 42
43 void PasswordGenerationPopupViewBridge::UpdateBoundsAndRedrawPopup() { 43 void PasswordGenerationPopupViewBridge::UpdateBoundsAndRedrawPopup() {
44 [view_ updateBoundsAndRedrawPopup]; 44 [view_ updateBoundsAndRedrawPopup];
45 } 45 }
46 46
47 void PasswordGenerationPopupViewBridge::PasswordSelectionUpdated() { 47 void PasswordGenerationPopupViewBridge::PasswordSelectionUpdated() {
48 [view_ setNeedsDisplay:YES]; 48 [view_ setNeedsDisplay:YES];
49 } 49 }
50 50
51 bool PasswordGenerationPopupViewBridge::IsPointInPasswordBounds( 51 bool PasswordGenerationPopupViewBridge::IsPointInPasswordBounds(
52 const gfx::Point& point) { 52 const gfx::Point& point) {
53 // TODO(gcasto): Implement this function. 53 return [view_ isPointInPasswordBounds:NSPointFromCGPoint(point.ToCGPoint())];
54 return true;
55 } 54 }
56 55
57 PasswordGenerationPopupView* PasswordGenerationPopupView::Create( 56 PasswordGenerationPopupView* PasswordGenerationPopupView::Create(
58 PasswordGenerationPopupController* controller) { 57 PasswordGenerationPopupController* controller) {
59 return new PasswordGenerationPopupViewBridge(controller); 58 return new PasswordGenerationPopupViewBridge(controller);
60 } 59 }
61 60
62 } // namespace autofill 61 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698