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

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

Issue 462563002: Add ManagePasswordsBubbleManageViewController and unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix views Created 6 years, 3 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 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 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_controller.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 8 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
9 #import "chrome/browser/ui/cocoa/info_bubble_view.h" 9 #import "chrome/browser/ui/cocoa/info_bubble_view.h"
10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
11 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_manage_view_c ontroller.h"
11 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 12 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
12 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_confirmation_ view_controller.h" 13 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_confirmation_ view_controller.h"
13 #include "ui/base/cocoa/window_size_constants.h" 14 #include "ui/base/cocoa/window_size_constants.h"
14 15
15 @interface ManagePasswordsBubbleController () 16 @interface ManagePasswordsBubbleController ()
16 // Updates the content view controller according to the current state. 17 // Updates the content view controller according to the current state.
17 - (void)updateState; 18 - (void)updateState;
18 @end 19 @end
19 20
20 @implementation ManagePasswordsBubbleController 21 @implementation ManagePasswordsBubbleController
(...skipping 26 matching lines...) Expand all
47 if (password_manager::ui::IsPendingState(model_->state())) { 48 if (password_manager::ui::IsPendingState(model_->state())) {
48 currentController_.reset( 49 currentController_.reset(
49 [[ManagePasswordsBubblePendingViewController alloc] 50 [[ManagePasswordsBubblePendingViewController alloc]
50 initWithModel:model_ 51 initWithModel:model_
51 delegate:self]); 52 delegate:self]);
52 } else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) { 53 } else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) {
53 currentController_.reset( 54 currentController_.reset(
54 [[ManagePasswordsBubbleConfirmationViewController alloc] 55 [[ManagePasswordsBubbleConfirmationViewController alloc]
55 initWithModel:model_ 56 initWithModel:model_
56 delegate:self]); 57 delegate:self]);
58 } else if (model_->state() == password_manager::ui::MANAGE_STATE) {
59 currentController_.reset([[ManagePasswordsBubbleManageViewController alloc]
60 initWithModel:model_
61 delegate:self]);
57 } 62 }
58 [self performLayout]; 63 [self performLayout];
59 } 64 }
60 65
61 - (void)performLayout { 66 - (void)performLayout {
62 if (!currentController_) 67 if (!currentController_)
63 return; 68 return;
64 69
65 // Update the window. 70 // Update the window.
66 NSWindow* window = [self window]; 71 NSWindow* window = [self window];
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 107
103 @end 108 @end
104 109
105 @implementation ManagePasswordsBubbleController (Testing) 110 @implementation ManagePasswordsBubbleController (Testing)
106 111
107 - (NSViewController*)currentController { 112 - (NSViewController*)currentController {
108 return currentController_.get(); 113 return currentController_.get();
109 } 114 }
110 115
111 @end 116 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698