OLD | NEW |
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/toolbar/toolbar_model.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 10 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 | 136 |
137 // ToolbarModelTest ----------------------------------------------------------- | 137 // ToolbarModelTest ----------------------------------------------------------- |
138 | 138 |
139 class ToolbarModelTest : public BrowserWithTestWindowTest { | 139 class ToolbarModelTest : public BrowserWithTestWindowTest { |
140 public: | 140 public: |
141 ToolbarModelTest(); | 141 ToolbarModelTest(); |
142 ToolbarModelTest(Browser::Type browser_type, | 142 ToolbarModelTest(Browser::Type browser_type, |
143 chrome::HostDesktopType host_desktop_type, | 143 chrome::HostDesktopType host_desktop_type, |
144 bool hosted_app); | 144 bool hosted_app); |
145 virtual ~ToolbarModelTest(); | 145 ~ToolbarModelTest() override; |
146 | 146 |
147 // BrowserWithTestWindowTest: | 147 // BrowserWithTestWindowTest: |
148 virtual void SetUp() override; | 148 void SetUp() override; |
149 | 149 |
150 protected: | 150 protected: |
151 void EnableOriginChipFieldTrial(); | 151 void EnableOriginChipFieldTrial(); |
152 void NavigateAndCheckText(const GURL& url, | 152 void NavigateAndCheckText(const GURL& url, |
153 const base::string16& expected_text, | 153 const base::string16& expected_text, |
154 bool would_perform_search_term_replacement, | 154 bool would_perform_search_term_replacement, |
155 bool should_display_url); | 155 bool should_display_url); |
156 | 156 |
157 private: | 157 private: |
158 scoped_ptr<base::FieldTrialList> field_trial_list_; | 158 scoped_ptr<base::FieldTrialList> field_trial_list_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 toolbar_model->WouldPerformSearchTermReplacement(true)); | 227 toolbar_model->WouldPerformSearchTermReplacement(true)); |
228 | 228 |
229 // Tell the ToolbarModel that the user has stopped editing. This prevents | 229 // Tell the ToolbarModel that the user has stopped editing. This prevents |
230 // this function from having side effects. | 230 // this function from having side effects. |
231 toolbar_model->set_input_in_progress(false); | 231 toolbar_model->set_input_in_progress(false); |
232 } | 232 } |
233 | 233 |
234 class PopupToolbarModelTest : public ToolbarModelTest { | 234 class PopupToolbarModelTest : public ToolbarModelTest { |
235 public: | 235 public: |
236 PopupToolbarModelTest(); | 236 PopupToolbarModelTest(); |
237 virtual ~PopupToolbarModelTest(); | 237 ~PopupToolbarModelTest() override; |
238 | 238 |
239 DISALLOW_COPY_AND_ASSIGN(PopupToolbarModelTest); | 239 DISALLOW_COPY_AND_ASSIGN(PopupToolbarModelTest); |
240 }; | 240 }; |
241 | 241 |
242 PopupToolbarModelTest::PopupToolbarModelTest() | 242 PopupToolbarModelTest::PopupToolbarModelTest() |
243 : ToolbarModelTest(Browser::TYPE_POPUP, | 243 : ToolbarModelTest(Browser::TYPE_POPUP, |
244 chrome::HOST_DESKTOP_TYPE_NATIVE, | 244 chrome::HOST_DESKTOP_TYPE_NATIVE, |
245 false) { | 245 false) { |
246 } | 246 } |
247 | 247 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 413 |
414 // Disabling URL replacement should reset to only showing URLs. | 414 // Disabling URL replacement should reset to only showing URLs. |
415 browser()->toolbar_model()->set_url_replacement_enabled(false); | 415 browser()->toolbar_model()->set_url_replacement_enabled(false); |
416 for (size_t i = 0; i < arraysize(test_items); ++i) { | 416 for (size_t i = 0; i < arraysize(test_items); ++i) { |
417 const TestItem& test_item = test_items[i]; | 417 const TestItem& test_item = test_items[i]; |
418 NavigateAndCheckText(test_item.url, | 418 NavigateAndCheckText(test_item.url, |
419 test_item.expected_text_url_replacement_inactive, | 419 test_item.expected_text_url_replacement_inactive, |
420 false, test_item.should_display_url); | 420 false, test_item.should_display_url); |
421 } | 421 } |
422 } | 422 } |
OLD | NEW |