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

Side by Side Diff: chrome/browser/ui/views/password_generation_bubble_view.h

Issue 10458018: This CL does the following: (1) Pass the max_length attribute to the password generator; (2) Update… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a bug in Windows UI. Created 8 years, 6 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_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 "chrome/browser/autofill/password_generator.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 // PasswordGenerationBubbleView is a bubble used to show possible generated 24 // PasswordGenerationBubbleView is a bubble used to show possible generated
25 // passwords to users. It is set in the page content, anchored at |anchor_rect|. 25 // 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 26 // If the generated password is accepted by the user, the renderer associated
27 // with |render_view_host| is informed. 27 // with |render_view_host| is informed.
28 class PasswordGenerationBubbleView : public views::BubbleDelegateView, 28 class PasswordGenerationBubbleView : public views::BubbleDelegateView,
29 public views::ButtonListener { 29 public views::ButtonListener {
30 public: 30 public:
31 PasswordGenerationBubbleView(const gfx::Rect& anchor_rect, 31 PasswordGenerationBubbleView(const gfx::Rect& anchor_rect,
32 int max_length,
32 views::View* anchor_view, 33 views::View* anchor_view,
33 content::RenderViewHost* render_view_host); 34 content::RenderViewHost* render_view_host);
34 virtual ~PasswordGenerationBubbleView(); 35 virtual ~PasswordGenerationBubbleView();
35 36
36 private: 37 private:
37 // views::BubbleDelegateView 38 // views::BubbleDelegateView
38 virtual void Init() OVERRIDE; 39 virtual void Init() OVERRIDE;
39 virtual gfx::Rect GetAnchorRect() OVERRIDE; 40 virtual gfx::Rect GetAnchorRect() OVERRIDE;
40 41
41 // views::ButtonListener 42 // views::ButtonListener
42 virtual void ButtonPressed(views::Button* sender, 43 virtual void ButtonPressed(views::Button* sender,
43 const views::Event& event) OVERRIDE; 44 const views::Event& event) OVERRIDE;
44 45
45 // Subviews 46 // Subviews
46 views::TextButton* accept_button_; 47 views::TextButton* accept_button_;
47 views::Textfield* text_field_; 48 views::Textfield* text_field_;
48 49
49 // Location that the bubble points to 50 // Location that the bubble points to
50 gfx::Rect anchor_rect_; 51 gfx::Rect anchor_rect_;
51 52
53 // Maximum password length;
54 int max_length_;
55
52 // RenderViewHost associated with the button that spawned this bubble. 56 // RenderViewHost associated with the button that spawned this bubble.
53 content::RenderViewHost* render_view_host_; 57 content::RenderViewHost* render_view_host_;
54 58
55 // Class to generate passwords 59 // Class to generate passwords
56 autofill::PasswordGenerator password_generator_; 60 autofill::PasswordGenerator password_generator_;
57 61
58 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleView); 62 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationBubbleView);
59 }; 63 };
60 64
61 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ 65 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698