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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 14259008: Instant Extended: Add prominent search term support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR, 420 command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR,
421 star_enabled); 421 star_enabled);
422 if (star_view_ && !extensions::FeatureSwitch::action_box()->IsEnabled()) 422 if (star_view_ && !extensions::FeatureSwitch::action_box()->IsEnabled())
423 star_view_->SetVisible(star_enabled); 423 star_view_->SetVisible(star_enabled);
424 424
425 if (action_box_button_view_) 425 if (action_box_button_view_)
426 action_box_button_view_->SetVisible(!model_->GetInputInProgress()); 426 action_box_button_view_->SetVisible(!model_->GetInputInProgress());
427 427
428 string16 search_provider; 428 string16 search_provider;
429 if (!model_->GetInputInProgress() && 429 if (!model_->GetInputInProgress() &&
430 model_->WouldReplaceSearchURLWithSearchTerms()) { 430 model_->GetSearchTermType() != ToolbarModel::SEARCH_TERM_NONE) {
Peter Kasting 2013/04/25 19:42:54 Nit: File style: parens around binary subexpressio
sail 2013/04/25 22:18:46 Done.
431 const TemplateURL* template_url = 431 const TemplateURL* template_url =
432 TemplateURLServiceFactory::GetForProfile(profile_)-> 432 TemplateURLServiceFactory::GetForProfile(profile_)->
433 GetDefaultSearchProvider(); 433 GetDefaultSearchProvider();
434 if (template_url && !template_url->short_name().empty()) { 434 if (template_url && !template_url->short_name().empty()) {
435 search_provider = l10n_util::GetStringFUTF16( 435 search_provider = l10n_util::GetStringFUTF16(
436 IDS_OMNIBOX_SEARCH_TOKEN_TEXT, template_url->short_name()); 436 IDS_OMNIBOX_SEARCH_TOKEN_TEXT, template_url->short_name());
437 search_token_view_->SetBackgroundColor(GetColor( 437 search_token_view_->SetBackgroundColor(GetColor(
438 model_->GetSecurityLevel(), LocationBarView::BACKGROUND)); 438 model_->GetSecurityLevel(), LocationBarView::BACKGROUND));
439 SkColor text_color = GetColor( 439 SkColor text_color = GetColor(
440 model_->GetSecurityLevel(), LocationBarView::DEEMPHASIZED_TEXT); 440 model_->GetSecurityLevel(), LocationBarView::DEEMPHASIZED_TEXT);
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 int LocationBarView::GetInternalHeight(bool use_preferred_size) { 1464 int LocationBarView::GetInternalHeight(bool use_preferred_size) {
1465 int total_height = 1465 int total_height =
1466 use_preferred_size ? GetPreferredSize().height() : height(); 1466 use_preferred_size ? GetPreferredSize().height() : height();
1467 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); 1467 return std::max(total_height - (kVerticalEdgeThickness * 2), 0);
1468 } 1468 }
1469 1469
1470 bool LocationBarView::HasValidSuggestText() const { 1470 bool LocationBarView::HasValidSuggestText() const {
1471 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && 1471 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() &&
1472 !suggested_text_view_->text().empty(); 1472 !suggested_text_view_->text().empty();
1473 } 1473 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698