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

Side by Side Diff: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc

Issue 10732002: Upstream rewrite of Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extreme nits. Created 8 years, 5 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
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/gtk/omnibox/omnibox_view_gtk.h" 5 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 1198
1199 gboolean OmniboxViewGtk::HandleViewFocusOut(GtkWidget* sender, 1199 gboolean OmniboxViewGtk::HandleViewFocusOut(GtkWidget* sender,
1200 GdkEventFocus* event) { 1200 GdkEventFocus* event) {
1201 DCHECK(text_view_); 1201 DCHECK(text_view_);
1202 GtkWidget* view_getting_focus = NULL; 1202 GtkWidget* view_getting_focus = NULL;
1203 GtkWindow* toplevel = platform_util::GetTopLevel(sender); 1203 GtkWindow* toplevel = platform_util::GetTopLevel(sender);
1204 if (gtk_window_is_active(toplevel)) 1204 if (gtk_window_is_active(toplevel))
1205 view_getting_focus = going_to_focus_; 1205 view_getting_focus = going_to_focus_;
1206 1206
1207 // This must be invoked before ClosePopup. 1207 // This must be invoked before ClosePopup.
1208 model_->OnWillKillFocus(view_getting_focus); 1208 model_->OnWillKillFocus();
1209 1209
1210 // Close the popup. 1210 // Close the popup.
1211 ClosePopup(); 1211 ClosePopup();
1212 // Tell the model to reset itself. 1212 // Tell the model to reset itself.
1213 model_->OnKillFocus(); 1213 model_->OnKillFocus();
1214 controller_->OnKillFocus(); 1214 controller_->OnKillFocus();
1215 1215
1216 g_signal_handlers_disconnect_by_func( 1216 g_signal_handlers_disconnect_by_func(
1217 gdk_keymap_get_for_display(gtk_widget_get_display(text_view_)), 1217 gdk_keymap_get_for_display(gtk_widget_get_display(text_view_)),
1218 reinterpret_cast<gpointer>(&HandleKeymapDirectionChangedThunk), this); 1218 reinterpret_cast<gpointer>(&HandleKeymapDirectionChangedThunk), this);
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 void OmniboxViewGtk::AdjustVerticalAlignmentOfInstantView() { 2242 void OmniboxViewGtk::AdjustVerticalAlignmentOfInstantView() {
2243 // By default, GtkTextView layouts an anchored child widget just above the 2243 // By default, GtkTextView layouts an anchored child widget just above the
2244 // baseline, so we need to move the |instant_view_| down to make sure it 2244 // baseline, so we need to move the |instant_view_| down to make sure it
2245 // has the same baseline as the |text_view_|. 2245 // has the same baseline as the |text_view_|.
2246 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); 2246 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_));
2247 int height; 2247 int height;
2248 pango_layout_get_size(layout, NULL, &height); 2248 pango_layout_get_size(layout, NULL, &height);
2249 int baseline = pango_layout_get_baseline(layout); 2249 int baseline = pango_layout_get_baseline(layout);
2250 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); 2250 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL);
2251 } 2251 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/omnibox/omnibox_edit_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698