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/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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 [self updateState]; | 35 [self updateState]; |
36 } | 36 } |
37 return self; | 37 return self; |
38 } | 38 } |
39 | 39 |
40 - (void)showWindow:(id)sender { | 40 - (void)showWindow:(id)sender { |
41 [self performLayout]; | 41 [self performLayout]; |
42 [super showWindow:sender]; | 42 [super showWindow:sender]; |
43 } | 43 } |
44 | 44 |
| 45 - (void)close { |
| 46 [currentController_ bubbleWillDisappear]; |
| 47 [super close]; |
| 48 } |
| 49 |
45 - (void)updateState { | 50 - (void)updateState { |
46 // Find the next view controller. | 51 // Find the next view controller. |
47 currentController_.reset(); | 52 currentController_.reset(); |
48 if (password_manager::ui::IsPendingState(model_->state())) { | 53 if (password_manager::ui::IsPendingState(model_->state())) { |
49 currentController_.reset( | 54 currentController_.reset( |
50 [[ManagePasswordsBubblePendingViewController alloc] | 55 [[ManagePasswordsBubblePendingViewController alloc] |
51 initWithModel:model_ | 56 initWithModel:model_ |
52 delegate:self]); | 57 delegate:self]); |
53 } else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) { | 58 } else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) { |
54 currentController_.reset( | 59 currentController_.reset( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 127 |
123 @end | 128 @end |
124 | 129 |
125 @implementation ManagePasswordsBubbleController (Testing) | 130 @implementation ManagePasswordsBubbleController (Testing) |
126 | 131 |
127 - (NSViewController*)currentController { | 132 - (NSViewController*)currentController { |
128 return currentController_.get(); | 133 return currentController_.get(); |
129 } | 134 } |
130 | 135 |
131 @end | 136 @end |
OLD | NEW |