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

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

Issue 10867038: A simple version of search term replacement for testing . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use url_parse 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 // NOTE: GetStateForTabSwitch may affect GetSelection, so order is important. 428 // NOTE: GetStateForTabSwitch may affect GetSelection, so order is important.
429 OmniboxEditModel::State model_state = model()->GetStateForTabSwitch(); 429 OmniboxEditModel::State model_state = model()->GetStateForTabSwitch();
430 GetStateAccessor()->SetProperty( 430 GetStateAccessor()->SetProperty(
431 tab->GetPropertyBag(), 431 tab->GetPropertyBag(),
432 AutocompleteEditState(model_state, ViewState(GetSelection()))); 432 AutocompleteEditState(model_state, ViewState(GetSelection())));
433 } 433 }
434 434
435 void OmniboxViewGtk::Update(const WebContents* contents) { 435 void OmniboxViewGtk::Update(const WebContents* contents) {
436 // NOTE: We're getting the URL text here from the ToolbarModel. 436 // NOTE: We're getting the URL text here from the ToolbarModel.
437 bool visibly_changed_permanent_text = 437 bool visibly_changed_permanent_text =
438 model()->UpdatePermanentText(toolbar_model()->GetText()); 438 model()->UpdatePermanentText(toolbar_model()->GetText(true));
439 439
440 ToolbarModel::SecurityLevel security_level = 440 ToolbarModel::SecurityLevel security_level =
441 toolbar_model()->GetSecurityLevel(); 441 toolbar_model()->GetSecurityLevel();
442 bool changed_security_level = (security_level != security_level_); 442 bool changed_security_level = (security_level != security_level_);
443 security_level_ = security_level; 443 security_level_ = security_level;
444 444
445 if (contents) { 445 if (contents) {
446 selected_text_.clear(); 446 selected_text_.clear();
447 RevertAll(); 447 RevertAll();
448 const AutocompleteEditState* state = 448 const AutocompleteEditState* state =
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698