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

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

Issue 928753003: Clean password_manager::ui::State (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master Created 5 years, 10 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
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"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 - (void)close { 45 - (void)close {
46 [currentController_ bubbleWillDisappear]; 46 [currentController_ bubbleWillDisappear];
47 [super close]; 47 [super close];
48 } 48 }
49 49
50 - (void)updateState { 50 - (void)updateState {
51 // Find the next view controller. 51 // Find the next view controller.
52 currentController_.reset(); 52 currentController_.reset();
53 if (password_manager::ui::IsPendingState(model_->state())) { 53 if (model_->state() == password_manager::ui::PENDING_PASSWORD_STATE) {
54 currentController_.reset( 54 currentController_.reset(
55 [[ManagePasswordsBubblePendingViewController alloc] 55 [[ManagePasswordsBubblePendingViewController alloc]
56 initWithModel:model_ 56 initWithModel:model_
57 delegate:self]); 57 delegate:self]);
58 } else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) { 58 } else if (model_->state() == password_manager::ui::CONFIRMATION_STATE) {
59 currentController_.reset( 59 currentController_.reset(
60 [[ManagePasswordsBubbleConfirmationViewController alloc] 60 [[ManagePasswordsBubbleConfirmationViewController alloc]
61 initWithModel:model_ 61 initWithModel:model_
62 delegate:self]); 62 delegate:self]);
63 } else if (model_->state() == password_manager::ui::MANAGE_STATE) { 63 } else if (model_->state() == password_manager::ui::MANAGE_STATE) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 @end 128 @end
129 129
130 @implementation ManagePasswordsBubbleController (Testing) 130 @implementation ManagePasswordsBubbleController (Testing)
131 131
132 - (NSViewController*)currentController { 132 - (NSViewController*)currentController {
133 return currentController_.get(); 133 return currentController_.get();
134 } 134 }
135 135
136 @end 136 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698