OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" |
10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
11 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 11 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
12 #include "components/password_manager/core/common/password_manager_ui.h" | 12 #include "components/password_manager/core/common/password_manager_ui.h" |
13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
14 #include "ui/gfx/range/range.h" | 14 #include "ui/gfx/range/range.h" |
15 | 15 |
16 class ManagePasswordsIconController; | 16 class ManagePasswordsIconController; |
17 class ManagePasswordsUIController; | 17 class ManagePasswordsUIController; |
| 18 class Profile; |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 class WebContents; | 21 class WebContents; |
21 } | 22 } |
22 | 23 |
23 // This model provides data for the ManagePasswordsBubble and controls the | 24 // This model provides data for the ManagePasswordsBubble and controls the |
24 // password management actions. | 25 // password management actions. |
25 class ManagePasswordsBubbleModel : public content::WebContentsObserver { | 26 class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
26 public: | 27 public: |
27 enum PasswordAction { REMOVE_PASSWORD, ADD_PASSWORD }; | 28 enum PasswordAction { REMOVE_PASSWORD, ADD_PASSWORD }; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 100 } |
100 const base::string16& manage_link() const { return manage_link_; } | 101 const base::string16& manage_link() const { return manage_link_; } |
101 bool never_save_passwords() const { return never_save_passwords_; } | 102 bool never_save_passwords() const { return never_save_passwords_; } |
102 const base::string16& save_confirmation_text() const { | 103 const base::string16& save_confirmation_text() const { |
103 return save_confirmation_text_; | 104 return save_confirmation_text_; |
104 } | 105 } |
105 const gfx::Range& save_confirmation_link_range() const { | 106 const gfx::Range& save_confirmation_link_range() const { |
106 return save_confirmation_link_range_; | 107 return save_confirmation_link_range_; |
107 } | 108 } |
108 | 109 |
| 110 Profile* GetProfile() const; |
| 111 |
109 #if defined(UNIT_TEST) | 112 #if defined(UNIT_TEST) |
110 // Gets and sets the reason the bubble was displayed. | 113 // Gets and sets the reason the bubble was displayed. |
111 password_manager::metrics_util::UIDisplayDisposition display_disposition() | 114 password_manager::metrics_util::UIDisplayDisposition display_disposition() |
112 const { | 115 const { |
113 return display_disposition_; | 116 return display_disposition_; |
114 } | 117 } |
115 | 118 |
116 // Gets the reason the bubble was dismissed. | 119 // Gets the reason the bubble was dismissed. |
117 password_manager::metrics_util::UIDismissalReason dismissal_reason() const { | 120 password_manager::metrics_util::UIDismissalReason dismissal_reason() const { |
118 return dismissal_reason_; | 121 return dismissal_reason_; |
(...skipping 21 matching lines...) Expand all Loading... |
140 // If true upon destruction, the user has confirmed that she never wants to | 143 // If true upon destruction, the user has confirmed that she never wants to |
141 // save passwords for a particular site. | 144 // save passwords for a particular site. |
142 bool never_save_passwords_; | 145 bool never_save_passwords_; |
143 password_manager::metrics_util::UIDisplayDisposition display_disposition_; | 146 password_manager::metrics_util::UIDisplayDisposition display_disposition_; |
144 password_manager::metrics_util::UIDismissalReason dismissal_reason_; | 147 password_manager::metrics_util::UIDismissalReason dismissal_reason_; |
145 | 148 |
146 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); | 149 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
147 }; | 150 }; |
148 | 151 |
149 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 152 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
OLD | NEW |