| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PASSWORD_GENERATION_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/public/common/password_form.h" |
| 9 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 10 #include "ui/views/bubble/bubble_delegate.h" | 11 #include "ui/views/bubble/bubble_delegate.h" |
| 11 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 12 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 13 #include "webkit/forms/password_form.h" | |
| 14 | 14 |
| 15 namespace autofill { | 15 namespace autofill { |
| 16 class PasswordGenerator; | 16 class PasswordGenerator; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class PageNavigator; | 20 class PageNavigator; |
| 21 class RenderViewHost; | 21 class RenderViewHost; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace views { | 24 namespace views { |
| 25 class ImageButton; | 25 class ImageButton; |
| 26 class Label; | 26 class Label; |
| 27 class TextButton; | 27 class TextButton; |
| 28 class Textfield; | 28 class Textfield; |
| 29 } | 29 } |
| 30 | 30 |
| 31 class PasswordManager; | 31 class PasswordManager; |
| 32 | 32 |
| 33 // PasswordGenerationBubbleView is a bubble used to show possible generated | 33 // PasswordGenerationBubbleView is a bubble used to show possible generated |
| 34 // passwords to users. It is set in the page content, anchored at |anchor_rect|. | 34 // passwords to users. It is set in the page content, anchored at |anchor_rect|. |
| 35 // If the generated password is accepted by the user, the renderer associated | 35 // If the generated password is accepted by the user, the renderer associated |
| 36 // with |render_view_host| and the |password_manager| are informed. | 36 // with |render_view_host| and the |password_manager| are informed. |
| 37 class PasswordGenerationBubbleView : public views::BubbleDelegateView, | 37 class PasswordGenerationBubbleView : public views::BubbleDelegateView, |
| 38 public views::ButtonListener { | 38 public views::ButtonListener { |
| 39 public: | 39 public: |
| 40 PasswordGenerationBubbleView(const webkit::forms::PasswordForm& form, | 40 PasswordGenerationBubbleView(const content::PasswordForm& form, |
| 41 const gfx::Rect& anchor_rect, | 41 const gfx::Rect& anchor_rect, |
| 42 views::View* anchor_view, | 42 views::View* anchor_view, |
| 43 content::RenderViewHost* render_view_host, | 43 content::RenderViewHost* render_view_host, |
| 44 PasswordManager* password_manager, | 44 PasswordManager* password_manager, |
| 45 autofill::PasswordGenerator* password_generator, | 45 autofill::PasswordGenerator* password_generator, |
| 46 content::PageNavigator* navigator, | 46 content::PageNavigator* navigator, |
| 47 ui::ThemeProvider* theme_provider); | 47 ui::ThemeProvider* theme_provider); |
| 48 virtual ~PasswordGenerationBubbleView(); | 48 virtual ~PasswordGenerationBubbleView(); |
| 49 | 49 |
| 50 // views::View | 50 // views::View |
| (...skipping 13 matching lines...) Expand all Loading... |
| 64 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 64 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
| 65 | 65 |
| 66 // Subviews | 66 // Subviews |
| 67 views::Label* title_label_; | 67 views::Label* title_label_; |
| 68 views::TextButton* accept_button_; | 68 views::TextButton* accept_button_; |
| 69 views::Textfield* textfield_; | 69 views::Textfield* textfield_; |
| 70 views::ImageButton* regenerate_button_; | 70 views::ImageButton* regenerate_button_; |
| 71 views::View* textfield_wrapper_; | 71 views::View* textfield_wrapper_; |
| 72 | 72 |
| 73 // The form associated with the password field(s) that we are generated. | 73 // The form associated with the password field(s) that we are generated. |
| 74 webkit::forms::PasswordForm form_; | 74 content::PasswordForm form_; |
| 75 | 75 |
| 76 // Location that the bubble points to | 76 // Location that the bubble points to |
| 77 gfx::Rect anchor_rect_; | 77 gfx::Rect anchor_rect_; |
| 78 | 78 |
| 79 // RenderViewHost associated with the button that spawned this bubble. | 79 // RenderViewHost associated with the button that spawned this bubble. |
| 80 content::RenderViewHost* render_view_host_; | 80 content::RenderViewHost* render_view_host_; |
| 81 | 81 |
| 82 // PasswordManager associated with this tab. | 82 // PasswordManager associated with this tab. |
| 83 PasswordManager* password_manager_; | 83 PasswordManager* password_manager_; |
| 84 | 84 |
| 85 // Object to generate passwords. The class won't take the ownership of it. | 85 // Object to generate passwords. The class won't take the ownership of it. |
| 86 autofill::PasswordGenerator* password_generator_; | 86 autofill::PasswordGenerator* password_generator_; |
| 87 | 87 |
| 88 // An object used to handle page loads that originate from link clicks | 88 // An object used to handle page loads that originate from link clicks |
| 89 // within this UI. | 89 // within this UI. |
| 90 content::PageNavigator* navigator_; | 90 content::PageNavigator* navigator_; |
| 91 | 91 |
| 92 // Theme provider used to draw the regenerate button. | 92 // Theme provider used to draw the regenerate button. |
| 93 ui::ThemeProvider* theme_provider_; | 93 ui::ThemeProvider* theme_provider_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleView); | 95 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleView); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ | 98 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ |
| OLD | NEW |