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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_external_delegate_views.cc

Issue 10825324: Start of New Autofill UI for Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h"
6
7 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h"
8
9 AutofillExternalDelegate* AutofillExternalDelegate::Create(
10 TabContents* tab_contents,
11 AutofillManager* autofill_manager) {
12 return new AutofillExternalDelegateViews(tab_contents, autofill_manager);
13 }
14
15 AutofillExternalDelegateViews::AutofillExternalDelegateViews(
16 TabContents* tab_contents,
17 AutofillManager* autofill_manager)
18 : AutofillExternalDelegate(tab_contents, autofill_manager),
19 view_(NULL) {
20 }
21
22 AutofillExternalDelegateViews::~AutofillExternalDelegateViews() {
23 delete view_;
24 }
25
26 void AutofillExternalDelegateViews::InvalidateView() {
27 view_ = NULL;
28 }
29
30 void AutofillExternalDelegateViews::HideAutofillPopupInternal() {
31 if (!view_)
32 return;
33
34 view_->Hide();
sky 2012/08/16 23:02:01 I know I asked this before, but how come delete vi
csharp 2012/08/20 20:59:00 Hide calls a virtual function in view_, so I can't
sky 2012/08/21 15:29:41 Can't the destructor in the base class take care o
csharp 2012/08/21 20:23:57 Done.
35
36 delete view_;
37 view_ = NULL;
38 }
39
40 void AutofillExternalDelegateViews::OnQueryPlatformSpecific(
41 int query_id,
42 const webkit::forms::FormData& form,
43 const webkit::forms::FormField& field,
44 const gfx::Rect& bounds) {
45 CreateViewIfNeeded();
46 view_->set_element_bounds(bounds);
47 }
48
49 void AutofillExternalDelegateViews::ApplyAutofillSuggestions(
50 const std::vector<string16>& autofill_values,
51 const std::vector<string16>& autofill_labels,
52 const std::vector<string16>& autofill_icons,
53 const std::vector<int>& autofill_unique_ids) {
54 CreateViewIfNeeded();
55
56 view_->Show(autofill_values,
57 autofill_labels,
58 autofill_icons,
59 autofill_unique_ids);
60 }
61
62 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) {
63 view_->SetBoundsRect(bounds);
64 }
65
66 void AutofillExternalDelegateViews::CreateViewIfNeeded() {
67 if (!view_)
68 view_ = new AutofillPopupViewViews(web_contents(), this);
69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698