OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/toolbar_model.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
6 | 6 |
7 #include "chrome/browser/search/search.h" | 7 #include "chrome/browser/search/search.h" |
8 | 8 |
9 ToolbarModel::ToolbarModel() | 9 ToolbarModel::ToolbarModel() |
10 : input_in_progress_(false), | 10 : input_in_progress_(false), |
11 origin_chip_enabled_(true), | 11 origin_chip_enabled_(true), |
12 url_replacement_enabled_(true) { | 12 url_replacement_enabled_(true) { |
13 } | 13 } |
14 | 14 |
15 ToolbarModel::~ToolbarModel() { | 15 ToolbarModel::~ToolbarModel() { |
16 } | 16 } |
17 | 17 |
18 bool ToolbarModel::WouldReplaceURL() const { | 18 bool ToolbarModel::WouldReplaceURL() const { |
19 return WouldOmitURLDueToOriginChip() || | 19 return WouldOmitURLDueToOriginChip() || |
20 WouldPerformSearchTermReplacement(false); | 20 WouldPerformSearchTermReplacement(false); |
21 } | 21 } |
22 | 22 |
23 bool ToolbarModel::ShouldShowOriginChip() const { | 23 bool ToolbarModel::ShouldShowOriginChip() const { |
24 return chrome::ShouldDisplayOriginChipV2() && | 24 return chrome::ShouldDisplayOriginChip() && WouldOmitURLDueToOriginChip() && |
25 WouldOmitURLDueToOriginChip() && | |
26 origin_chip_enabled(); | 25 origin_chip_enabled(); |
27 } | 26 } |
OLD | NEW |