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

Side by Side Diff: chrome/browser/autofill/autofill_external_delegate_gtk.cc

Issue 10396003: Add Icon Support for New Autofill Gtk UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
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 #include "chrome/browser/autofill/autofill_external_delegate_gtk.h" 5 #include "chrome/browser/autofill/autofill_external_delegate_gtk.h"
6 6
7 #include "chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h" 7 #include "chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h"
8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_view.h" 10 #include "content/public/browser/web_contents_view.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void AutofillExternalDelegateGtk::SetBounds(const gfx::Rect& bounds) { 62 void AutofillExternalDelegateGtk::SetBounds(const gfx::Rect& bounds) {
63 CreateViewIfNeeded(); 63 CreateViewIfNeeded();
64 view_->set_element_bounds(bounds); 64 view_->set_element_bounds(bounds);
65 } 65 }
66 66
67 void AutofillExternalDelegateGtk::CreateViewIfNeeded() { 67 void AutofillExternalDelegateGtk::CreateViewIfNeeded() {
68 if (view_.get()) 68 if (view_.get())
69 return; 69 return;
70 70
71 view_.reset(new AutofillPopupViewGtk(web_contents_, 71 view_.reset(new AutofillPopupViewGtk(web_contents_,
72 profile(),
72 this, 73 this,
73 tab_native_view_)); 74 tab_native_view_));
74 75
75 GtkWidget* toplevel = gtk_widget_get_toplevel(tab_native_view_); 76 GtkWidget* toplevel = gtk_widget_get_toplevel(tab_native_view_);
76 if (!g_signal_handler_is_connected(toplevel, event_handler_id_)) { 77 if (!g_signal_handler_is_connected(toplevel, event_handler_id_)) {
77 event_handler_id_ = g_signal_connect( 78 event_handler_id_ = g_signal_connect(
78 toplevel, 79 toplevel,
79 "focus-out-event", 80 "focus-out-event",
80 G_CALLBACK(HandleViewFocusOutThunk), 81 G_CALLBACK(HandleViewFocusOutThunk),
81 this); 82 this);
82 } 83 }
83 } 84 }
84 85
85 gboolean AutofillExternalDelegateGtk::HandleViewFocusOut(GtkWidget* sender, 86 gboolean AutofillExternalDelegateGtk::HandleViewFocusOut(GtkWidget* sender,
86 GdkEventFocus* event) { 87 GdkEventFocus* event) {
87 HideAutofillPopup(); 88 HideAutofillPopup();
88 89
89 return TRUE; 90 return TRUE;
90 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698