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 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_state.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_state.h" |
10 #include "chrome/browser/ui/passwords/passwords_client_ui_delegate.h" | 10 #include "chrome/browser/ui/passwords/passwords_client_ui_delegate.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const GURL& origin) override; | 60 const GURL& origin) override; |
61 | 61 |
62 // PasswordStore::Observer: | 62 // PasswordStore::Observer: |
63 void OnLoginsChanged( | 63 void OnLoginsChanged( |
64 const password_manager::PasswordStoreChangeList& changes) override; | 64 const password_manager::PasswordStoreChangeList& changes) override; |
65 | 65 |
66 // Set the state of the Omnibox icon, and possibly show the associated bubble | 66 // Set the state of the Omnibox icon, and possibly show the associated bubble |
67 // without user interaction. | 67 // without user interaction. |
68 virtual void UpdateIconAndBubbleState(ManagePasswordsIconView* icon); | 68 virtual void UpdateIconAndBubbleState(ManagePasswordsIconView* icon); |
69 | 69 |
70 bool IsAutomaticallyOpeningBubble() const { return should_pop_up_bubble_; } | 70 bool IsAutomaticallyOpeningBubble() const { |
| 71 return bubble_status_ == SHOULD_POP_UP; |
| 72 } |
71 | 73 |
72 // PasswordsModelDelegate: | 74 // PasswordsModelDelegate: |
73 const GURL& GetOrigin() const override; | 75 const GURL& GetOrigin() const override; |
74 password_manager::ui::State GetState() const override; | 76 password_manager::ui::State GetState() const override; |
75 const autofill::PasswordForm& GetPendingPassword() const override; | 77 const autofill::PasswordForm& GetPendingPassword() const override; |
76 bool IsPasswordOverridden() const override; | 78 bool IsPasswordOverridden() const override; |
77 const std::vector<const autofill::PasswordForm*>& GetCurrentForms() | 79 const std::vector<const autofill::PasswordForm*>& GetCurrentForms() |
78 const override; | 80 const override; |
79 const std::vector<const autofill::PasswordForm*>& GetFederatedForms() | 81 const std::vector<const autofill::PasswordForm*>& GetFederatedForms() |
80 const override; | 82 const override; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 128 |
127 // content::WebContentsObserver: | 129 // content::WebContentsObserver: |
128 void DidNavigateMainFrame( | 130 void DidNavigateMainFrame( |
129 const content::LoadCommittedDetails& details, | 131 const content::LoadCommittedDetails& details, |
130 const content::FrameNavigateParams& params) override; | 132 const content::FrameNavigateParams& params) override; |
131 void WasHidden() override; | 133 void WasHidden() override; |
132 | 134 |
133 private: | 135 private: |
134 friend class content::WebContentsUserData<ManagePasswordsUIController>; | 136 friend class content::WebContentsUserData<ManagePasswordsUIController>; |
135 | 137 |
| 138 enum BubbleStatus { |
| 139 NOT_SHOWN, |
| 140 // The bubble is to be popped up in the next call to |
| 141 // UpdateBubbleAndIconVisibility(). |
| 142 SHOULD_POP_UP, |
| 143 SHOWN, |
| 144 }; |
| 145 |
136 // Shows the password bubble without user interaction. | 146 // Shows the password bubble without user interaction. |
137 void ShowBubbleWithoutUserInteraction(); | 147 void ShowBubbleWithoutUserInteraction(); |
138 | 148 |
139 // Closes the account chooser gracefully so the callback is called. Then sets | 149 // Closes the account chooser gracefully so the callback is called. Then sets |
140 // the state to MANAGE_STATE. | 150 // the state to MANAGE_STATE. |
141 void DestroyAccountChooser(); | 151 void DestroyAccountChooser(); |
142 | 152 |
143 // content::WebContentsObserver: | 153 // content::WebContentsObserver: |
144 void WebContentsDestroyed() override; | 154 void WebContentsDestroyed() override; |
145 | 155 |
146 // The wrapper around current state and data. | 156 // The wrapper around current state and data. |
147 ManagePasswordsState passwords_data_; | 157 ManagePasswordsState passwords_data_; |
148 | 158 |
149 // The controller for the blocking dialogs. | 159 // The controller for the blocking dialogs. |
150 scoped_ptr<PasswordDialogControllerImpl> dialog_controller_; | 160 scoped_ptr<PasswordDialogControllerImpl> dialog_controller_; |
151 | 161 |
152 // Contains true if the bubble is to be popped up in the next call to | 162 BubbleStatus bubble_status_; |
153 // UpdateBubbleAndIconVisibility(). | |
154 bool should_pop_up_bubble_; | |
155 | 163 |
156 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); | 164 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); |
157 }; | 165 }; |
158 | 166 |
159 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 167 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
OLD | NEW |