| 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_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 11 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 12 #include "chrome/common/password_generation_util.h" | 12 #include "chrome/common/password_generation_util.h" |
| 13 #include "content/public/common/password_form.h" |
| 13 #include "ui/base/gtk/gtk_signal.h" | 14 #include "ui/base/gtk/gtk_signal.h" |
| 14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 15 #include "webkit/forms/password_form.h" | |
| 16 | 16 |
| 17 namespace autofill { | 17 namespace autofill { |
| 18 class PasswordGenerator; | 18 class PasswordGenerator; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class TabContents; | 21 class TabContents; |
| 22 | 22 |
| 23 // PasswordGenerationBubbleGtk is a bubble use to show possible generated | 23 // PasswordGenerationBubbleGtk is a bubble use to show possible generated |
| 24 // passwords to users. It is set in page content, anchored at |anchor_rect|. | 24 // passwords to users. It is set in page content, anchored at |anchor_rect|. |
| 25 // If the generated password is accepted by the user, the renderer associated | 25 // If the generated password is accepted by the user, the renderer associated |
| 26 // with |render_view_host| and the |password_manager| are informed. | 26 // with |render_view_host| and the |password_manager| are informed. |
| 27 class PasswordGenerationBubbleGtk : public BubbleDelegateGtk { | 27 class PasswordGenerationBubbleGtk : public BubbleDelegateGtk { |
| 28 public: | 28 public: |
| 29 PasswordGenerationBubbleGtk(const gfx::Rect& anchor_rect, | 29 PasswordGenerationBubbleGtk(const gfx::Rect& anchor_rect, |
| 30 const webkit::forms::PasswordForm& form, | 30 const content::PasswordForm& form, |
| 31 TabContents* tab, | 31 TabContents* tab, |
| 32 autofill::PasswordGenerator* password_generator); | 32 autofill::PasswordGenerator* password_generator); |
| 33 virtual ~PasswordGenerationBubbleGtk(); | 33 virtual ~PasswordGenerationBubbleGtk(); |
| 34 | 34 |
| 35 // Overridden from BubbleDelegateGtk: | 35 // Overridden from BubbleDelegateGtk: |
| 36 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; | 36 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnDestroy); | 39 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnDestroy); |
| 40 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnAcceptClicked); | 40 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnAcceptClicked); |
| 41 CHROMEGTK_CALLBACK_2(PasswordGenerationBubbleGtk, void, OnRegenerateClicked, | 41 CHROMEGTK_CALLBACK_2(PasswordGenerationBubbleGtk, void, OnRegenerateClicked, |
| 42 GtkEntryIconPosition, GdkEvent*); | 42 GtkEntryIconPosition, GdkEvent*); |
| 43 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnPasswordEdited); | 43 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnPasswordEdited); |
| 44 CHROMEG_CALLBACK_0( | 44 CHROMEG_CALLBACK_0( |
| 45 PasswordGenerationBubbleGtk, void, OnLearnMoreLinkClicked, GtkButton*); | 45 PasswordGenerationBubbleGtk, void, OnLearnMoreLinkClicked, GtkButton*); |
| 46 | 46 |
| 47 BubbleGtk* bubble_; | 47 BubbleGtk* bubble_; |
| 48 GtkWidget* text_field_; | 48 GtkWidget* text_field_; |
| 49 | 49 |
| 50 // Form that contains the password field that we are generating a password | 50 // Form that contains the password field that we are generating a password |
| 51 // for. Used by the password_manager_. | 51 // for. Used by the password_manager_. |
| 52 webkit::forms::PasswordForm form_; | 52 content::PasswordForm form_; |
| 53 | 53 |
| 54 // TabContents associated with the button that spawned this bubble. | 54 // TabContents associated with the button that spawned this bubble. |
| 55 TabContents* tab_; | 55 TabContents* tab_; |
| 56 | 56 |
| 57 // Object that deals with generating passwords. The class won't take the | 57 // Object that deals with generating passwords. The class won't take the |
| 58 // ownership of it. | 58 // ownership of it. |
| 59 autofill::PasswordGenerator* password_generator_; | 59 autofill::PasswordGenerator* password_generator_; |
| 60 | 60 |
| 61 // Store various status of the current living bubble. | 61 // Store various status of the current living bubble. |
| 62 password_generation::PasswordGenerationActions actions_; | 62 password_generation::PasswordGenerationActions actions_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleGtk); | 64 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleGtk); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ | 67 #endif // CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ |
| OLD | NEW |