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/autofill/autofill_external_delegate_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h" | 7 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h" |
8 | 8 |
9 void AutofillExternalDelegate::CreateForWebContentsAndManager( | 9 void AutofillExternalDelegate::CreateForWebContentsAndManager( |
10 content::WebContents* web_contents, | 10 content::WebContents* web_contents, |
11 AutofillManager* autofill_manager) { | 11 AutofillManager* autofill_manager) { |
12 if (FromWebContents(web_contents)) | 12 if (FromWebContents(web_contents)) |
13 return; | 13 return; |
14 | 14 |
15 web_contents->SetUserData( | 15 web_contents->SetUserData( |
16 &kLocatorKey, | 16 UserDataKey(), |
17 new AutofillExternalDelegateViews(web_contents, autofill_manager)); | 17 new AutofillExternalDelegateViews(web_contents, autofill_manager)); |
18 } | 18 } |
19 | 19 |
20 AutofillExternalDelegateViews::AutofillExternalDelegateViews( | 20 AutofillExternalDelegateViews::AutofillExternalDelegateViews( |
21 content::WebContents* web_contents, | 21 content::WebContents* web_contents, |
22 AutofillManager* autofill_manager) | 22 AutofillManager* autofill_manager) |
23 : AutofillExternalDelegate(web_contents, autofill_manager), | 23 : AutofillExternalDelegate(web_contents, autofill_manager), |
24 popup_view_(NULL) { | 24 popup_view_(NULL) { |
25 } | 25 } |
26 | 26 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) { | 67 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) { |
68 popup_view_->SetBoundsRect(bounds); | 68 popup_view_->SetBoundsRect(bounds); |
69 } | 69 } |
70 | 70 |
71 void AutofillExternalDelegateViews::CreateViewIfNeeded() { | 71 void AutofillExternalDelegateViews::CreateViewIfNeeded() { |
72 if (!popup_view_) | 72 if (!popup_view_) |
73 popup_view_ = new AutofillPopupViewViews(web_contents(), this); | 73 popup_view_ = new AutofillPopupViewViews(web_contents(), this); |
74 } | 74 } |
OLD | NEW |