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 #include "chrome/browser/ui/views/password_generation_bubble_view.h" | 5 #include "chrome/browser/ui/views/password_generation_bubble_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/autofill/password_generator.h" | 8 #include "chrome/browser/autofill/password_generator.h" |
9 #include "chrome/browser/password_manager/password_manager.h" | 9 #include "chrome/browser/password_manager/password_manager.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 gfx::Size TextfieldWrapper::GetImageSize() const { | 111 gfx::Size TextfieldWrapper::GetImageSize() const { |
112 // The image is sized so that it fills the space between the borders | 112 // The image is sized so that it fills the space between the borders |
113 // completely. | 113 // completely. |
114 int size = (textfield_->GetPreferredSize().height() + | 114 int size = (textfield_->GetPreferredSize().height() + |
115 (kTextfieldVerticalPadding - kWrapperBorderSize) * 2); | 115 (kTextfieldVerticalPadding - kWrapperBorderSize) * 2); |
116 return gfx::Size(size, size); | 116 return gfx::Size(size, size); |
117 } | 117 } |
118 } // namespace | 118 } // namespace |
119 | 119 |
120 PasswordGenerationBubbleView::PasswordGenerationBubbleView( | 120 PasswordGenerationBubbleView::PasswordGenerationBubbleView( |
121 const webkit::forms::PasswordForm& form, | 121 const content::PasswordForm& form, |
122 const gfx::Rect& anchor_rect, | 122 const gfx::Rect& anchor_rect, |
123 views::View* anchor_view, | 123 views::View* anchor_view, |
124 content::RenderViewHost* render_view_host, | 124 content::RenderViewHost* render_view_host, |
125 PasswordManager* password_manager, | 125 PasswordManager* password_manager, |
126 autofill::PasswordGenerator* password_generator, | 126 autofill::PasswordGenerator* password_generator, |
127 content::PageNavigator* navigator, | 127 content::PageNavigator* navigator, |
128 ui::ThemeProvider* theme_provider) | 128 ui::ThemeProvider* theme_provider) |
129 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), | 129 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), |
130 title_label_(NULL), | 130 title_label_(NULL), |
131 accept_button_(NULL), | 131 accept_button_(NULL), |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 224 } |
225 if (sender == regenerate_button_) { | 225 if (sender == regenerate_button_) { |
226 textfield_->SetText( | 226 textfield_->SetText( |
227 ASCIIToUTF16(password_generator_->Generate())); | 227 ASCIIToUTF16(password_generator_->Generate())); |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { | 231 views::View* PasswordGenerationBubbleView::GetInitiallyFocusedView() { |
232 return textfield_; | 232 return textfield_; |
233 } | 233 } |
OLD | NEW |