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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view.cc

Issue 266263002: [OriginChip] Add an option to display only on search result pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to comments Created 6 years, 7 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 // This file defines helper functions shared by the various implementations 5 // This file defines helper functions shared by the various implementations
6 // of OmniboxView. 6 // of OmniboxView.
7 7
8 #include "chrome/browser/ui/omnibox/omnibox_view.h" 8 #include "chrome/browser/ui/omnibox/omnibox_view.h"
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 return base::string16(); 84 return base::string16();
85 } 85 }
86 86
87 OmniboxView::~OmniboxView() { 87 OmniboxView::~OmniboxView() {
88 } 88 }
89 89
90 void OmniboxView::HandleOriginChipMouseRelease() { 90 void OmniboxView::HandleOriginChipMouseRelease() {
91 // HIDE_ON_MOUSE_RELEASE only hides if there isn't any current text in the 91 // HIDE_ON_MOUSE_RELEASE only hides if there isn't any current text in the
92 // Omnibox (e.g. search terms). 92 // Omnibox (e.g. search terms).
93 if ((chrome::GetOriginChipV2HideTrigger() == 93 if ((chrome::GetOriginChipV2Condition() ==
94 chrome::ORIGIN_CHIP_V2_HIDE_ON_MOUSE_RELEASE) && 94 chrome::ORIGIN_CHIP_V2_HIDE_ON_MOUSE_RELEASE) &&
95 controller()->GetToolbarModel()->GetText().empty()) { 95 controller()->GetToolbarModel()->GetText().empty()) {
96 controller()->HideOriginChip(); 96 controller()->HideOriginChip();
97 } 97 }
98 } 98 }
99 99
100 void OmniboxView::OnDidKillFocus() { 100 void OmniboxView::OnDidKillFocus() {
101 if (chrome::ShouldDisplayOriginChipV2() && 101 if (chrome::ShouldDisplayOriginChipV2() &&
102 !model()->user_input_in_progress()) { 102 !model()->user_input_in_progress()) {
103 controller()->ShowOriginChip(); 103 controller()->ShowOriginChip();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // |profile| can be NULL in tests. 222 // |profile| can be NULL in tests.
223 if (profile) 223 if (profile)
224 model_.reset(new OmniboxEditModel(this, controller, profile)); 224 model_.reset(new OmniboxEditModel(this, controller, profile));
225 } 225 }
226 226
227 void OmniboxView::TextChanged() { 227 void OmniboxView::TextChanged() {
228 EmphasizeURLComponents(); 228 EmphasizeURLComponents();
229 if (model_.get()) 229 if (model_.get())
230 model_->OnChanged(); 230 model_->OnChanged();
231 } 231 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_edit_model.cc ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698