Chromium Code Reviews| 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/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 17 matching lines...) Expand all Loading... | |
| 28 // Shows the bubble. | 28 // Shows the bubble. |
| 29 static void ShowBubble(content::WebContents* web_contents, | 29 static void ShowBubble(content::WebContents* web_contents, |
| 30 DisplayReason reason); | 30 DisplayReason reason); |
| 31 | 31 |
| 32 // Closes the existing bubble. | 32 // Closes the existing bubble. |
| 33 static void CloseCurrentBubble(); | 33 static void CloseCurrentBubble(); |
| 34 | 34 |
| 35 // Makes the bubble the foreground window. | 35 // Makes the bubble the foreground window. |
| 36 static void ActivateBubble(); | 36 static void ActivateBubble(); |
| 37 | 37 |
| 38 // Returns true if a bubble is currently shown. | |
| 39 static bool IsBubbleShown(); | |
|
tapted
2017/04/12 05:08:42
nit: maybe `IsBubbleShowing()` (`shown` may imply
varkha
2017/04/12 09:16:43
Done.
| |
| 40 | |
| 38 // Returns a pointer to the bubble. | 41 // Returns a pointer to the bubble. |
| 39 static ManagePasswordsBubbleView* manage_password_bubble() { | 42 static ManagePasswordsBubbleView* manage_password_bubble() { |
| 40 return manage_passwords_bubble_; | 43 return manage_passwords_bubble_; |
| 41 } | 44 } |
| 42 | 45 |
| 46 ManagePasswordsBubbleView(content::WebContents* web_contents, | |
| 47 views::View* anchor_view, | |
| 48 const gfx::Point& anchor_point, | |
| 49 DisplayReason reason); | |
| 50 | |
| 43 content::WebContents* web_contents() const; | 51 content::WebContents* web_contents() const; |
| 44 | 52 |
| 45 #if defined(UNIT_TEST) | 53 #if defined(UNIT_TEST) |
| 46 const View* initially_focused_view() const { | 54 const View* initially_focused_view() const { |
| 47 return initially_focused_view_; | 55 return initially_focused_view_; |
| 48 } | 56 } |
| 49 | 57 |
| 50 static void set_auto_signin_toast_timeout(int seconds) { | 58 static void set_auto_signin_toast_timeout(int seconds) { |
| 51 auto_signin_toast_timeout_ = seconds; | 59 auto_signin_toast_timeout_ = seconds; |
| 52 } | 60 } |
| 53 #endif | 61 #endif |
| 54 | 62 |
| 55 ManagePasswordsBubbleModel* model() { return &model_; } | 63 ManagePasswordsBubbleModel* model() { return &model_; } |
| 56 | 64 |
| 57 private: | 65 private: |
| 58 class AutoSigninView; | 66 class AutoSigninView; |
| 59 class ManageView; | 67 class ManageView; |
| 60 class PendingView; | 68 class PendingView; |
| 61 class SaveConfirmationView; | 69 class SaveConfirmationView; |
| 62 class SignInPromoView; | 70 class SignInPromoView; |
| 63 class UpdatePendingView; | 71 class UpdatePendingView; |
| 64 | 72 |
| 65 ManagePasswordsBubbleView(content::WebContents* web_contents, | |
| 66 views::View* anchor_view, | |
| 67 DisplayReason reason); | |
| 68 ~ManagePasswordsBubbleView() override; | 73 ~ManagePasswordsBubbleView() override; |
| 69 | 74 |
| 70 // LocationBarBubbleDelegateView: | 75 // LocationBarBubbleDelegateView: |
| 71 views::View* GetInitiallyFocusedView() override; | 76 views::View* GetInitiallyFocusedView() override; |
| 72 void Init() override; | 77 void Init() override; |
| 73 void CloseBubble() override; | 78 void CloseBubble() override; |
| 74 | 79 |
| 75 // WidgetDelegate: | 80 // WidgetDelegate: |
| 76 base::string16 GetWindowTitle() const override; | 81 base::string16 GetWindowTitle() const override; |
| 77 gfx::ImageSkia GetWindowIcon() override; | 82 gfx::ImageSkia GetWindowIcon() override; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 102 ManagePasswordsBubbleModel model_; | 107 ManagePasswordsBubbleModel model_; |
| 103 | 108 |
| 104 views::View* initially_focused_view_; | 109 views::View* initially_focused_view_; |
| 105 | 110 |
| 106 std::unique_ptr<WebContentMouseHandler> mouse_handler_; | 111 std::unique_ptr<WebContentMouseHandler> mouse_handler_; |
| 107 | 112 |
| 108 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); | 113 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); |
| 109 }; | 114 }; |
| 110 | 115 |
| 111 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 116 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
| OLD | NEW |