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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 6 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
7 #include "chrome/browser/search_engines/template_url_service_factory.h" | 7 #include "chrome/browser/search_engines/template_url_service_factory.h" |
8 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 8 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
9 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
10 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 10 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 : OmniboxEditController(NULL), | 101 : OmniboxEditController(NULL), |
102 toolbar_model_(toolbar_model) { | 102 toolbar_model_(toolbar_model) { |
103 } | 103 } |
104 | 104 |
105 protected: | 105 protected: |
106 // OmniboxEditController: | 106 // OmniboxEditController: |
107 void Update(const content::WebContents* contents) override {} | 107 void Update(const content::WebContents* contents) override {} |
108 void OnChanged() override {} | 108 void OnChanged() override {} |
109 void OnSetFocus() override {} | 109 void OnSetFocus() override {} |
110 void ShowURL() override {} | 110 void ShowURL() override {} |
111 void HideURL() override {} | |
112 void EndOriginChipAnimations(bool cancel_fade) override {} | |
113 InstantController* GetInstant() override { return NULL; } | 111 InstantController* GetInstant() override { return NULL; } |
114 WebContents* GetWebContents() override { return NULL; } | 112 WebContents* GetWebContents() override { return NULL; } |
115 ToolbarModel* GetToolbarModel() override { return toolbar_model_; } | 113 ToolbarModel* GetToolbarModel() override { return toolbar_model_; } |
116 const ToolbarModel* GetToolbarModel() const override { | 114 const ToolbarModel* GetToolbarModel() const override { |
117 return toolbar_model_; | 115 return toolbar_model_; |
118 } | 116 } |
119 | 117 |
120 private: | 118 private: |
121 ToolbarModel* toolbar_model_; | 119 ToolbarModel* toolbar_model_; |
122 | 120 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 249 |
252 model.SetUserText(UTF8ToUTF16("he")); | 250 model.SetUserText(UTF8ToUTF16("he")); |
253 model.OnPopupDataChanged(UTF8ToUTF16("llo"), NULL, base::string16(), false); | 251 model.OnPopupDataChanged(UTF8ToUTF16("llo"), NULL, base::string16(), false); |
254 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); | 252 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); |
255 EXPECT_EQ(UTF8ToUTF16("llo"), view.inline_autocomplete_text()); | 253 EXPECT_EQ(UTF8ToUTF16("llo"), view.inline_autocomplete_text()); |
256 | 254 |
257 model.AcceptTemporaryTextAsUserText(); | 255 model.AcceptTemporaryTextAsUserText(); |
258 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); | 256 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); |
259 EXPECT_EQ(base::string16(), view.inline_autocomplete_text()); | 257 EXPECT_EQ(base::string16(), view.inline_autocomplete_text()); |
260 } | 258 } |
OLD | NEW |