Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/autofill/password_generator.h" | 9 #include "base/basictypes.h" |
|
Garrett Casto
2012/06/04 23:50:52
Same here.
zysxqn
2012/06/05 16:18:14
Also for DISALLOW_COPY_AND_ASSIGN.
| |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/views/bubble/bubble_delegate.h" | 11 #include "ui/views/bubble/bubble_delegate.h" |
| 12 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 14 | 14 |
| 15 namespace autofill { | |
| 16 class PasswordGenerator; | |
| 17 } | |
| 18 | |
| 15 namespace content { | 19 namespace content { |
| 16 class RenderViewHost; | 20 class RenderViewHost; |
| 17 } | 21 } |
| 18 | 22 |
| 19 namespace views { | 23 namespace views { |
| 20 class TextButton; | 24 class TextButton; |
| 21 class Textfield; | 25 class Textfield; |
| 22 } | 26 } |
| 23 | 27 |
| 24 // PasswordGenerationBubbleView is a bubble used to show possible generated | 28 // PasswordGenerationBubbleView is a bubble used to show possible generated |
| 25 // passwords to users. It is set in the page content, anchored at |anchor_rect|. | 29 // passwords to users. It is set in the page content, anchored at |anchor_rect|. |
| 26 // If the generated password is accepted by the user, the renderer associated | 30 // If the generated password is accepted by the user, the renderer associated |
| 27 // with |render_view_host| is informed. | 31 // with |render_view_host| is informed. |
| 28 class PasswordGenerationBubbleView : public views::BubbleDelegateView, | 32 class PasswordGenerationBubbleView : public views::BubbleDelegateView, |
| 29 public views::ButtonListener { | 33 public views::ButtonListener { |
| 30 public: | 34 public: |
| 31 PasswordGenerationBubbleView(const gfx::Rect& anchor_rect, | 35 PasswordGenerationBubbleView(const gfx::Rect& anchor_rect, |
| 32 views::View* anchor_view, | 36 views::View* anchor_view, |
| 33 content::RenderViewHost* render_view_host); | 37 content::RenderViewHost* render_view_host, |
| 38 autofill::PasswordGenerator* password_generator); | |
| 34 virtual ~PasswordGenerationBubbleView(); | 39 virtual ~PasswordGenerationBubbleView(); |
| 35 | 40 |
| 36 private: | 41 private: |
| 37 // views::BubbleDelegateView | 42 // views::BubbleDelegateView |
| 38 virtual void Init() OVERRIDE; | 43 virtual void Init() OVERRIDE; |
| 39 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 44 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
| 40 | 45 |
| 41 // views::ButtonListener | 46 // views::ButtonListener |
| 42 virtual void ButtonPressed(views::Button* sender, | 47 virtual void ButtonPressed(views::Button* sender, |
| 43 const views::Event& event) OVERRIDE; | 48 const views::Event& event) OVERRIDE; |
| 44 | 49 |
| 45 // Subviews | 50 // Subviews |
| 46 views::TextButton* accept_button_; | 51 views::TextButton* accept_button_; |
| 47 views::Textfield* text_field_; | 52 views::Textfield* text_field_; |
| 48 | 53 |
| 49 // Location that the bubble points to | 54 // Location that the bubble points to |
| 50 gfx::Rect anchor_rect_; | 55 gfx::Rect anchor_rect_; |
| 51 | 56 |
| 52 // RenderViewHost associated with the button that spawned this bubble. | 57 // RenderViewHost associated with the button that spawned this bubble. |
| 53 content::RenderViewHost* render_view_host_; | 58 content::RenderViewHost* render_view_host_; |
| 54 | 59 |
| 55 // Class to generate passwords | 60 // Object to generate passwords |
| 56 autofill::PasswordGenerator password_generator_; | 61 autofill::PasswordGenerator* password_generator_; |
| 57 | 62 |
| 58 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleView); | 63 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleView); |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ | 66 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ |
| OLD | NEW |