OLD | NEW |
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 // Hooking up this handler after setting up above hacks for Instant view, so | 378 // Hooking up this handler after setting up above hacks for Instant view, so |
379 // that we won't filter out the special ZWP mark itself. | 379 // that we won't filter out the special ZWP mark itself. |
380 g_signal_connect(text_buffer_, "insert-text", | 380 g_signal_connect(text_buffer_, "insert-text", |
381 G_CALLBACK(&HandleInsertTextThunk), this); | 381 G_CALLBACK(&HandleInsertTextThunk), this); |
382 | 382 |
383 AdjustVerticalAlignmentOfInstantView(); | 383 AdjustVerticalAlignmentOfInstantView(); |
384 | 384 |
385 ui::MultiAnimation::Parts parts; | 385 ui::MultiAnimation::Parts parts; |
386 parts.push_back(ui::MultiAnimation::Part( | 386 parts.push_back(ui::MultiAnimation::Part( |
387 InstantController::kAutoCommitPauseTimeMS, ui::Tween::ZERO)); | 387 InstantController::kInlineAutocompletePauseTimeMS, ui::Tween::ZERO)); |
388 parts.push_back(ui::MultiAnimation::Part( | 388 parts.push_back(ui::MultiAnimation::Part( |
389 InstantController::kAutoCommitFadeInTimeMS, ui::Tween::EASE_IN)); | 389 InstantController::kInlineAutocompleteFadeInTimeMS, ui::Tween::EASE_IN)); |
390 instant_animation_.reset(new ui::MultiAnimation(parts)); | 390 instant_animation_.reset(new ui::MultiAnimation(parts)); |
391 instant_animation_->set_continuous(false); | 391 instant_animation_->set_continuous(false); |
392 | 392 |
393 registrar_.Add(this, | 393 registrar_.Add(this, |
394 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 394 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
395 content::Source<ThemeService>(theme_service_)); | 395 content::Source<ThemeService>(theme_service_)); |
396 theme_service_->InitThemesFor(this); | 396 theme_service_->InitThemesFor(this); |
397 | 397 |
398 ViewIDUtil::SetID(GetNativeView(), VIEW_ID_AUTOCOMPLETE); | 398 ViewIDUtil::SetID(GetNativeView(), VIEW_ID_AUTOCOMPLETE); |
399 } | 399 } |
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 void OmniboxViewGtk::AdjustVerticalAlignmentOfInstantView() { | 2174 void OmniboxViewGtk::AdjustVerticalAlignmentOfInstantView() { |
2175 // By default, GtkTextView layouts an anchored child widget just above the | 2175 // By default, GtkTextView layouts an anchored child widget just above the |
2176 // baseline, so we need to move the |instant_view_| down to make sure it | 2176 // baseline, so we need to move the |instant_view_| down to make sure it |
2177 // has the same baseline as the |text_view_|. | 2177 // has the same baseline as the |text_view_|. |
2178 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); | 2178 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); |
2179 int height; | 2179 int height; |
2180 pango_layout_get_size(layout, NULL, &height); | 2180 pango_layout_get_size(layout, NULL, &height); |
2181 int baseline = pango_layout_get_baseline(layout); | 2181 int baseline = pango_layout_get_baseline(layout); |
2182 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); | 2182 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); |
2183 } | 2183 } |
OLD | NEW |