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

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

Issue 10836031: Remove Instant v1 API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix 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
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 // Hooking up this handler after setting up above hacks for Instant view, so 381 // Hooking up this handler after setting up above hacks for Instant view, so
382 // that we won't filter out the special ZWP mark itself. 382 // that we won't filter out the special ZWP mark itself.
383 g_signal_connect(text_buffer_, "insert-text", 383 g_signal_connect(text_buffer_, "insert-text",
384 G_CALLBACK(&HandleInsertTextThunk), this); 384 G_CALLBACK(&HandleInsertTextThunk), this);
385 385
386 AdjustVerticalAlignmentOfInstantView(); 386 AdjustVerticalAlignmentOfInstantView();
387 387
388 ui::MultiAnimation::Parts parts; 388 ui::MultiAnimation::Parts parts;
389 parts.push_back(ui::MultiAnimation::Part( 389 parts.push_back(ui::MultiAnimation::Part(
390 InstantController::kAutoCommitPauseTimeMS, ui::Tween::ZERO)); 390 InstantController::kInlineAutocompletePauseTimeMS, ui::Tween::ZERO));
391 parts.push_back(ui::MultiAnimation::Part( 391 parts.push_back(ui::MultiAnimation::Part(
392 InstantController::kAutoCommitFadeInTimeMS, ui::Tween::EASE_IN)); 392 InstantController::kInlineAutocompleteFadeInTimeMS, ui::Tween::EASE_IN));
393 instant_animation_.reset(new ui::MultiAnimation(parts)); 393 instant_animation_.reset(new ui::MultiAnimation(parts));
394 instant_animation_->set_continuous(false); 394 instant_animation_->set_continuous(false);
395 395
396 registrar_.Add(this, 396 registrar_.Add(this,
397 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 397 chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
398 content::Source<ThemeService>(theme_service_)); 398 content::Source<ThemeService>(theme_service_));
399 theme_service_->InitThemesFor(this); 399 theme_service_->InitThemesFor(this);
400 400
401 ViewIDUtil::SetID(GetNativeView(), VIEW_ID_AUTOCOMPLETE); 401 ViewIDUtil::SetID(GetNativeView(), VIEW_ID_AUTOCOMPLETE);
402 } 402 }
(...skipping 1839 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

Powered by Google App Engine
This is Rietveld 408576698