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