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

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 }
20
21 AutofillExternalDelegateViews::~AutofillExternalDelegateViews() {
22 }
23
24 void AutofillExternalDelegateViews::HideAutofillPopupInternal() {
25 if (!view_.get())
26 return;
27
28 view_->Hide();
sky 2012/08/15 21:07:29 Why do you need hide here?
csharp 2012/08/16 19:16:27 Without this hide the popup doesn't disappear (sin
sky 2012/08/16 20:00:15 You're saying the Hide deletes? Doesn't it eventua
csharp 2012/08/16 21:39:15 I think you've got it right. This will lead to the
29 view_.reset();
30 }
31
32 void AutofillExternalDelegateViews::OnQueryPlatformSpecific(
33 int query_id,
34 const webkit::forms::FormData& form,
35 const webkit::forms::FormField& field,
36 const gfx::Rect& bounds) {
37 CreateViewIfNeeded();
38 view_->set_element_bounds(bounds);
39 }
40
41 void AutofillExternalDelegateViews::ApplyAutofillSuggestions(
42 const std::vector<string16>& autofill_values,
43 const std::vector<string16>& autofill_labels,
44 const std::vector<string16>& autofill_icons,
45 const std::vector<int>& autofill_unique_ids) {
46 CreateViewIfNeeded();
47
48 view_->Show(autofill_values,
49 autofill_labels,
50 autofill_icons,
51 autofill_unique_ids);
52 }
53
54 void AutofillExternalDelegateViews::SetBounds(const gfx::Rect& bounds) {
55 view_->SetBoundsRect(bounds);
56 }
57
58 void AutofillExternalDelegateViews::CreateViewIfNeeded() {
59 if (!view_.get())
60 view_.reset(new AutofillPopupViewViews(web_contents(), this));
61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698