Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: chrome/browser/ui/gtk/password_generation_bubble_gtk.h

Issue 10787023: Adding UMA stats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
12 #include "chrome/common/password_generation_util.h"
11 #include "ui/base/gtk/gtk_signal.h" 13 #include "ui/base/gtk/gtk_signal.h"
12 #include "ui/gfx/rect.h" 14 #include "ui/gfx/rect.h"
13 #include "webkit/forms/password_form.h" 15 #include "webkit/forms/password_form.h"
14 16
15 namespace autofill { 17 namespace autofill {
16 class PasswordGenerator; 18 class PasswordGenerator;
17 } 19 }
18 20
19 class BubbleGtk;
20 class TabContents; 21 class TabContents;
21 22
22 // PasswordGenerationBubbleGtk is a bubble use to show possible generated 23 // PasswordGenerationBubbleGtk is a bubble use to show possible generated
23 // 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|.
24 // 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
25 // with |render_view_host| and the |password_manager| are informed. 26 // with |render_view_host| and the |password_manager| are informed.
26 class PasswordGenerationBubbleGtk { 27 class PasswordGenerationBubbleGtk : public BubbleDelegateGtk{
jar (doing other things) 2012/07/19 00:05:42 nit: space before curly
zysxqn 2012/07/19 18:49:29 Done.
27 public: 28 public:
28 PasswordGenerationBubbleGtk(const gfx::Rect& anchor_rect, 29 PasswordGenerationBubbleGtk(const gfx::Rect& anchor_rect,
29 const webkit::forms::PasswordForm& form, 30 const webkit::forms::PasswordForm& form,
30 TabContents* tab, 31 TabContents* tab,
31 autofill::PasswordGenerator* password_generator); 32 autofill::PasswordGenerator* password_generator);
32 virtual ~PasswordGenerationBubbleGtk(); 33 virtual ~PasswordGenerationBubbleGtk();
33 34
35 // Overridden from BubbleDelegateGtk:
36 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
37
34 private: 38 private:
35 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnDestroy); 39 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnDestroy);
36 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnAcceptClicked); 40 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnAcceptClicked);
37 CHROMEGTK_CALLBACK_2(PasswordGenerationBubbleGtk, void, OnRegenerateClicked, 41 CHROMEGTK_CALLBACK_2(PasswordGenerationBubbleGtk, void, OnRegenerateClicked,
38 GtkEntryIconPosition, GdkEvent*); 42 GtkEntryIconPosition, GdkEvent*);
43 CHROMEGTK_CALLBACK_0(PasswordGenerationBubbleGtk, void, OnPasswordEdited);
39 CHROMEG_CALLBACK_0( 44 CHROMEG_CALLBACK_0(
40 PasswordGenerationBubbleGtk, void, OnLearnMoreLinkClicked, GtkButton*); 45 PasswordGenerationBubbleGtk, void, OnLearnMoreLinkClicked, GtkButton*);
41 46
42 BubbleGtk* bubble_; 47 BubbleGtk* bubble_;
43 GtkWidget* text_field_; 48 GtkWidget* text_field_;
44 49
45 // 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
46 // for. Used by the password_manager_. 51 // for. Used by the password_manager_.
47 webkit::forms::PasswordForm form_; 52 webkit::forms::PasswordForm form_;
48 53
49 // TabContents associated with the button that spawned this bubble. 54 // TabContents associated with the button that spawned this bubble.
50 TabContents* tab_; 55 TabContents* tab_;
51 56
52 // 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
53 // ownership of it. 58 // ownership of it.
54 autofill::PasswordGenerator* password_generator_; 59 autofill::PasswordGenerator* password_generator_;
55 60
61 // Store various status of the current living bubble.
62 password_generation::PasswordGenerationActions actions_;
63
56 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleGtk); 64 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleGtk);
57 }; 65 };
58 66
59 #endif // CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_ 67 #endif // CHROME_BROWSER_UI_GTK_PASSWORD_GENERATION_BUBBLE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698