OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 G_CALLBACK(&HandleWindowSetFocusThunk), this); | 421 G_CALLBACK(&HandleWindowSetFocusThunk), this); |
422 } | 422 } |
423 | 423 |
424 void OmniboxViewGtk::SetFocus() { | 424 void OmniboxViewGtk::SetFocus() { |
425 DCHECK(text_view_); | 425 DCHECK(text_view_); |
426 gtk_widget_grab_focus(text_view_); | 426 gtk_widget_grab_focus(text_view_); |
427 } | 427 } |
428 | 428 |
429 void OmniboxViewGtk::ApplyCaretVisibility() { | 429 void OmniboxViewGtk::ApplyCaretVisibility() { |
430 // TODO(mathp): implement for Linux. | 430 // TODO(mathp): implement for Linux. |
431 NOTIMPLEMENTED(); | |
PaulePantert
2013/03/06 09:07:37
I thought it was discussed in the bug report to ju
samarth
2013/03/06 18:32:08
We discussed changing NOTIMPLEMENTED so it doesn't
| |
432 } | 431 } |
433 | 432 |
434 int OmniboxViewGtk::WidthOfTextAfterCursor() { | 433 int OmniboxViewGtk::WidthOfTextAfterCursor() { |
435 // Not used. | 434 // Not used. |
436 return -1; | 435 return -1; |
437 } | 436 } |
438 | 437 |
439 void OmniboxViewGtk::SaveStateToTab(WebContents* tab) { | 438 void OmniboxViewGtk::SaveStateToTab(WebContents* tab) { |
440 DCHECK(tab); | 439 DCHECK(tab); |
441 // If any text has been selected, register it as the PRIMARY selection so it | 440 // If any text has been selected, register it as the PRIMARY selection so it |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2139 void OmniboxViewGtk::AdjustVerticalAlignmentOfInstantView() { | 2138 void OmniboxViewGtk::AdjustVerticalAlignmentOfInstantView() { |
2140 // By default, GtkTextView layouts an anchored child widget just above the | 2139 // By default, GtkTextView layouts an anchored child widget just above the |
2141 // baseline, so we need to move the |instant_view_| down to make sure it | 2140 // baseline, so we need to move the |instant_view_| down to make sure it |
2142 // has the same baseline as the |text_view_|. | 2141 // has the same baseline as the |text_view_|. |
2143 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); | 2142 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(instant_view_)); |
2144 int height; | 2143 int height; |
2145 pango_layout_get_size(layout, NULL, &height); | 2144 pango_layout_get_size(layout, NULL, &height); |
2146 int baseline = pango_layout_get_baseline(layout); | 2145 int baseline = pango_layout_get_baseline(layout); |
2147 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); | 2146 g_object_set(instant_anchor_tag_, "rise", baseline - height, NULL); |
2148 } | 2147 } |
OLD | NEW |