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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h

Issue 2907983002: Allow dialogs to use a custom View as their title. (Closed)
Patch Set: merge Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
index ea2c923a95338424ed2be3e74bd30a3c9b764437..f35aa55387ec666bef8c10bd287f22fcd10f3398 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
@@ -9,6 +9,7 @@
#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
#include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h"
#include "ui/base/ui_features.h"
+#include "ui/views/controls/styled_label_listener.h"
namespace content {
class WebContents;
@@ -22,7 +23,8 @@ class WebContents;
// 2. ManageView: Displays the current page's saved credentials.
// 3. BlacklistedView: Informs the user that the current page is blacklisted.
//
-class ManagePasswordsBubbleView : public LocationBarBubbleDelegateView {
+class ManagePasswordsBubbleView : public LocationBarBubbleDelegateView,
+ public views::StyledLabelListener {
public:
static constexpr int kDesiredBubbleWidth = 370;
@@ -77,17 +79,23 @@ class ManagePasswordsBubbleView : public LocationBarBubbleDelegateView {
views::View* GetInitiallyFocusedView() override;
void Init() override;
void CloseBubble() override;
-
- // WidgetDelegate:
+ void AddedToWidget() override;
base::string16 GetWindowTitle() const override;
gfx::ImageSkia GetWindowIcon() override;
- bool ShouldShowWindowTitle() const override;
bool ShouldShowWindowIcon() const override;
bool ShouldShowCloseButton() const override;
+ // views::StyledLabelListener:
+ void StyledLabelLinkClicked(views::StyledLabel* label,
+ const gfx::Range& range,
+ int event_flags) override;
+
// Refreshes the bubble's state.
void Refresh();
+ // Updates |title_view|'s text and link styling from |model_|.
+ void UpdateTitleText(views::StyledLabel* title_view);
+
// Sets up a child view according to the model state.
void CreateChild();

Powered by Google App Engine
This is Rietveld 408576698