| 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_model.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 10 #include "ui/views/bubble/bubble_delegate.h" | 10 #include "ui/views/bubble/bubble_delegate.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 static void ShowBubble(content::WebContents* web_contents, | 31 static void ShowBubble(content::WebContents* web_contents, |
| 32 ManagePasswordsIconView* icon_view); | 32 ManagePasswordsIconView* icon_view); |
| 33 | 33 |
| 34 // Closes any existing bubble. | 34 // Closes any existing bubble. |
| 35 static void CloseBubble(); | 35 static void CloseBubble(); |
| 36 | 36 |
| 37 // Whether the bubble is currently showing. | 37 // Whether the bubble is currently showing. |
| 38 static bool IsShowing(); | 38 static bool IsShowing(); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 ManagePasswordsBubbleView(views::View* anchor_view, | 41 ManagePasswordsBubbleView(content::WebContents* web_contents, |
| 42 content::WebContents* web_contents, | 42 views::View* anchor_view, |
| 43 ManagePasswordsIconView* icon_view); | 43 ManagePasswordsIconView* icon_view); |
| 44 virtual ~ManagePasswordsBubbleView(); | 44 virtual ~ManagePasswordsBubbleView(); |
| 45 | 45 |
| 46 // Returns the maximum width needed for the username or password field(s). | 46 // Returns the maximum width needed for the username (if |username| is set) or |
| 47 // Both can take a maximum of 22 characters. If username is set it will return | 47 // password field, based on the actual usernames and passwords that need to be |
| 48 // the maximum width for the username, else the one for the password fields. | 48 // shown. |
| 49 int GetMaximumUsernameOrPasswordWidth(bool username); | 49 int GetMaximumUsernameOrPasswordWidth(bool username); |
| 50 | 50 |
| 51 // If the bubble is not anchored to a view, places the bubble in the top | 51 // If the bubble is not anchored to a view, places the bubble in the top |
| 52 // right (left in RTL) of the |screen_bounds| that contain |web_contents_|'s | 52 // right (left in RTL) of the |screen_bounds| that contain |web_contents_|'s |
| 53 // browser window. Because the positioning is based on the size of the | 53 // browser window. Because the positioning is based on the size of the |
| 54 // bubble, this must be called after the bubble is created. | 54 // bubble, this must be called after the bubble is created. |
| 55 void AdjustForFullscreen(const gfx::Rect& screen_bounds); | 55 void AdjustForFullscreen(const gfx::Rect& screen_bounds); |
| 56 | 56 |
| 57 void Close(); | 57 void Close(); |
| 58 | 58 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 78 // The buttons that are shown in the bubble. | 78 // The buttons that are shown in the bubble. |
| 79 views::BlueButton* save_button_; | 79 views::BlueButton* save_button_; |
| 80 views::LabelButton* cancel_button_; | 80 views::LabelButton* cancel_button_; |
| 81 views::Link* manage_link_; | 81 views::Link* manage_link_; |
| 82 views::LabelButton* done_button_; | 82 views::LabelButton* done_button_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); | 84 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleView); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ | 87 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_VIEW_H_ |
| OLD | NEW |