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 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
10 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 10 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
11 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 11 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
12 #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" |
13 #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h" | |
14 #import "chrome/browser/ui/cocoa/passwords/auto_signin_view_controller.h" | 13 #import "chrome/browser/ui/cocoa/passwords/auto_signin_view_controller.h" |
15 #import "chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_cont
roller.h" | 14 #import "chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_cont
roller.h" |
16 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.h" | 15 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.h" |
17 #import "chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller
.h" | 16 #import "chrome/browser/ui/cocoa/passwords/save_pending_password_view_controller
.h" |
18 #import "chrome/browser/ui/cocoa/passwords/update_pending_password_view_controll
er.h" | 17 #import "chrome/browser/ui/cocoa/passwords/update_pending_password_view_controll
er.h" |
19 #include "ui/base/cocoa/window_size_constants.h" | 18 #include "ui/base/cocoa/window_size_constants.h" |
20 | 19 |
21 @interface ManagePasswordsBubbleController () | 20 @interface ManagePasswordsBubbleController () |
22 // Updates the content view controller according to the current state. | 21 // Updates the content view controller according to the current state. |
23 - (void)updateState; | 22 - (void)updateState; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } else if (model_->state() == password_manager::ui::MANAGE_STATE) { | 75 } else if (model_->state() == password_manager::ui::MANAGE_STATE) { |
77 currentController_.reset( | 76 currentController_.reset( |
78 [[ManagePasswordsBubbleManageViewController alloc] | 77 [[ManagePasswordsBubbleManageViewController alloc] |
79 initWithModel:model_ | 78 initWithModel:model_ |
80 delegate:self]); | 79 delegate:self]); |
81 } else if (model_->state() == password_manager::ui::AUTO_SIGNIN_STATE) { | 80 } else if (model_->state() == password_manager::ui::AUTO_SIGNIN_STATE) { |
82 currentController_.reset( | 81 currentController_.reset( |
83 [[ManagePasswordsBubbleAutoSigninViewController alloc] | 82 [[ManagePasswordsBubbleAutoSigninViewController alloc] |
84 initWithModel:model_ | 83 initWithModel:model_ |
85 delegate:self]); | 84 delegate:self]); |
86 } else if (model_->state() == | |
87 password_manager::ui::CREDENTIAL_REQUEST_STATE) { | |
88 currentController_.reset( | |
89 [[ManagePasswordsBubbleAccountChooserViewController alloc] | |
90 initWithModel:model_ | |
91 delegate:self]); | |
92 } else { | 85 } else { |
93 NOTREACHED(); | 86 NOTREACHED(); |
94 } | 87 } |
95 } | 88 } |
96 | 89 |
97 - (void)performLayout { | 90 - (void)performLayout { |
98 if (!currentController_) | 91 if (!currentController_) |
99 return; | 92 return; |
100 | 93 |
101 // Update the window. | 94 // Update the window. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 150 |
158 @end | 151 @end |
159 | 152 |
160 @implementation ManagePasswordsBubbleController (Testing) | 153 @implementation ManagePasswordsBubbleController (Testing) |
161 | 154 |
162 - (NSViewController*)currentController { | 155 - (NSViewController*)currentController { |
163 return currentController_.get(); | 156 return currentController_.get(); |
164 } | 157 } |
165 | 158 |
166 @end | 159 @end |
OLD | NEW |