| 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_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" |
| 10 #include "chrome/browser/ui/views/passwords/save_password_refusal_combobox_model
.h" | 10 #include "chrome/browser/ui/views/passwords/save_password_refusal_combobox_model
.h" |
| 11 #include "ui/views/bubble/bubble_delegate.h" | 11 #include "ui/views/bubble/bubble_delegate.h" |
| 12 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 13 #include "ui/views/controls/combobox/combobox.h" | 13 #include "ui/views/controls/combobox/combobox.h" |
| 14 #include "ui/views/controls/combobox/combobox_listener.h" | 14 #include "ui/views/controls/combobox/combobox_listener.h" |
| 15 #include "ui/views/controls/link.h" | 15 #include "ui/views/controls/link.h" |
| 16 #include "ui/views/controls/link_listener.h" | 16 #include "ui/views/controls/link_listener.h" |
| 17 #include "ui/views/controls/styled_label_listener.h" |
| 17 | 18 |
| 18 class ManagePasswordsIconView; | 19 class ManagePasswordsIconView; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 class WebContents; | 22 class WebContents; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace views { | 25 namespace views { |
| 25 class BlueButton; | 26 class BlueButton; |
| 26 class LabelButton; | 27 class LabelButton; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // views::ButtonListener: | 122 // views::ButtonListener: |
| 122 virtual void ButtonPressed(views::Button* sender, | 123 virtual void ButtonPressed(views::Button* sender, |
| 123 const ui::Event& event) OVERRIDE; | 124 const ui::Event& event) OVERRIDE; |
| 124 | 125 |
| 125 ManagePasswordsBubbleView* parent_; | 126 ManagePasswordsBubbleView* parent_; |
| 126 | 127 |
| 127 views::BlueButton* unblacklist_button_; | 128 views::BlueButton* unblacklist_button_; |
| 128 views::LabelButton* done_button_; | 129 views::LabelButton* done_button_; |
| 129 }; | 130 }; |
| 130 | 131 |
| 132 // A view confirming to the user that a password was saved and offering a link |
| 133 // to the Google account manager. |
| 134 class SaveConfirmationView : public views::View, |
| 135 public views::ButtonListener, |
| 136 public views::StyledLabelListener { |
| 137 public: |
| 138 explicit SaveConfirmationView(ManagePasswordsBubbleView* parent); |
| 139 virtual ~SaveConfirmationView(); |
| 140 |
| 141 private: |
| 142 // views::ButtonListener: |
| 143 virtual void ButtonPressed(views::Button* sender, |
| 144 const ui::Event& event) OVERRIDE; |
| 145 |
| 146 // views::StyledLabelListener implementation |
| 147 virtual void StyledLabelLinkClicked(const gfx::Range& range, |
| 148 int event_flags) OVERRIDE; |
| 149 |
| 150 ManagePasswordsBubbleView* parent_; |
| 151 |
| 152 views::LabelButton* ok_button_; |
| 153 }; |
| 154 |
| 131 // Shows the bubble. | 155 // Shows the bubble. |
| 132 static void ShowBubble(content::WebContents* web_contents, | 156 static void ShowBubble(content::WebContents* web_contents, |
| 133 DisplayReason reason); | 157 DisplayReason reason); |
| 134 | 158 |
| 135 // Closes any existing bubble. | 159 // Closes any existing bubble. |
| 136 static void CloseBubble(); | 160 static void CloseBubble(); |
| 137 | 161 |
| 138 // Whether the bubble is currently showing. | 162 // Whether the bubble is currently showing. |
| 139 static bool IsShowing(); | 163 static bool IsShowing(); |
| 140 | 164 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 ManagePasswordsIconView* anchor_view_; | 205 ManagePasswordsIconView* anchor_view_; |
| 182 | 206 |
| 183 // If true upon destruction, the user has confirmed that she never wants to | 207 // If true upon destruction, the user has confirmed that she never wants to |
| 184 // save passwords for a particular site. | 208 // save passwords for a particular site. |
| 185 bool never_save_passwords_; | 209 bool never_save_passwords_; |
| 186 | 210 |
| 187 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); | 211 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); |
| 188 }; | 212 }; |
| 189 | 213 |
| 190 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 214 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
| OLD | NEW |