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

Side by Side Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h

Issue 2033713002: Implement the Chrome Sign-in promo bubble for password manager on Views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 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 unified diff | Download patch
OLDNEW
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/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
10 #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view .h" 10 #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view .h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 static void set_auto_signin_toast_timeout(int seconds) { 50 static void set_auto_signin_toast_timeout(int seconds) {
51 auto_signin_toast_timeout_ = seconds; 51 auto_signin_toast_timeout_ = seconds;
52 } 52 }
53 #endif 53 #endif
54 54
55 ManagePasswordsBubbleModel* model() { return &model_; } 55 ManagePasswordsBubbleModel* model() { return &model_; }
56 56
57 private: 57 private:
58 class AutoSigninView; 58 class AutoSigninView;
59 class BlacklistedView;
60 class ManageView; 59 class ManageView;
61 class PendingView; 60 class PendingView;
62 class SaveConfirmationView; 61 class SaveConfirmationView;
62 class SignInPromoView;
63 class UpdatePendingView; 63 class UpdatePendingView;
64 class WebContentMouseHandler; 64 class WebContentMouseHandler;
65 65
66 ManagePasswordsBubbleView(content::WebContents* web_contents, 66 ManagePasswordsBubbleView(content::WebContents* web_contents,
67 views::View* anchor_view, 67 views::View* anchor_view,
68 DisplayReason reason); 68 DisplayReason reason);
69 ~ManagePasswordsBubbleView() override; 69 ~ManagePasswordsBubbleView() override;
70 70
71 // LocationBarBubbleDelegateView: 71 // LocationBarBubbleDelegateView:
72 views::View* GetInitiallyFocusedView() override; 72 views::View* GetInitiallyFocusedView() override;
73 void Init() override; 73 void Init() override;
74 void CloseBubble() override; 74 void CloseBubble() override;
75 75
76 // WidgetDelegate: 76 // WidgetDelegate:
77 base::string16 GetWindowTitle() const override; 77 base::string16 GetWindowTitle() const override;
78 bool ShouldShowWindowTitle() const override; 78 bool ShouldShowWindowTitle() const override;
79 bool ShouldShowCloseButton() const override; 79 bool ShouldShowCloseButton() const override;
80 80
81 // Refreshes the bubble's state: called to display a confirmation screen after 81 // Refreshes the bubble's state.
82 // a user selects "Never for this site", for instance.
83 void Refresh(); 82 void Refresh();
84 83
84 // Sets up a child view according to the model state.
85 void CreateChild();
86
85 void set_initially_focused_view(views::View* view) { 87 void set_initially_focused_view(views::View* view) {
86 DCHECK(!initially_focused_view_); 88 DCHECK(!initially_focused_view_);
87 initially_focused_view_ = view; 89 initially_focused_view_ = view;
88 } 90 }
89 91
90 // Singleton instance of the Password bubble. The Password bubble can only be 92 // Singleton instance of the Password bubble. The Password bubble can only be
91 // shown on the active browser window, so there is no case in which it will be 93 // shown on the active browser window, so there is no case in which it will be
92 // shown twice at the same time. The instance is owned by the Bubble and will 94 // shown twice at the same time. The instance is owned by the Bubble and will
93 // be deleted when the bubble closes. 95 // be deleted when the bubble closes.
94 static ManagePasswordsBubbleView* manage_passwords_bubble_; 96 static ManagePasswordsBubbleView* manage_passwords_bubble_;
95 97
96 // The timeout in seconds for the auto sign-in toast. 98 // The timeout in seconds for the auto sign-in toast.
97 static int auto_signin_toast_timeout_; 99 static int auto_signin_toast_timeout_;
98 100
99 ManagePasswordsBubbleModel model_; 101 ManagePasswordsBubbleModel model_;
100 102
101 views::View* initially_focused_view_; 103 views::View* initially_focused_view_;
102 104
103 // A helper to intercept mouse click events on the web contents. 105 // A helper to intercept mouse click events on the web contents.
104 std::unique_ptr<WebContentMouseHandler> mouse_handler_; 106 std::unique_ptr<WebContentMouseHandler> mouse_handler_;
105 107
106 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); 108 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView);
107 }; 109 };
108 110
109 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ 111 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698