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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc

Issue 2731123002: Fix some issues with OmniboxViewViews' use of OmniboxClient. (Closed)
Patch Set: Resync Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
index 2499ff045ed11b81baee569cc4d6c3a7a4f4d130..11e237f1b0fe623281251898d5a40cfcfbbc5569 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
@@ -12,8 +12,10 @@
#include "build/build_config.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/ui/omnibox/chrome_omnibox_client.h"
#include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/omnibox/browser/omnibox_edit_model.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ime/text_edit_commands.h"
@@ -41,7 +43,7 @@ class TestingOmniboxView : public OmniboxViewViews {
};
TestingOmniboxView(OmniboxEditController* controller,
- Profile* profile,
+ std::unique_ptr<OmniboxClient> client,
CommandUpdater* command_updater);
static BaseTextEmphasis to_emphasis(bool emphasize) {
@@ -79,7 +81,6 @@ class TestingOmniboxView : public OmniboxViewViews {
size_t update_popup_call_count_ = 0;
base::string16 update_popup_text_;
Range update_popup_selection_range_;
- Profile* profile_;
// Range of the last scheme logged by UpdateSchemeStyle().
Range scheme_range_;
@@ -94,15 +95,14 @@ class TestingOmniboxView : public OmniboxViewViews {
};
TestingOmniboxView::TestingOmniboxView(OmniboxEditController* controller,
- Profile* profile,
+ std::unique_ptr<OmniboxClient> client,
CommandUpdater* command_updater)
: OmniboxViewViews(controller,
- profile,
+ std::move(client),
command_updater,
false,
nullptr,
- gfx::FontList()),
- profile_(profile) {}
+ gfx::FontList()) {}
void TestingOmniboxView::ResetEmphasisTestState() {
base_text_emphasis_ = UNSET;
@@ -120,7 +120,7 @@ void TestingOmniboxView::CheckUpdatePopupCallInfo(
}
void TestingOmniboxView::EmphasizeURLComponents() {
- UpdateTextStyle(text(), ChromeAutocompleteSchemeClassifier(profile_));
+ UpdateTextStyle(text(), model()->client()->GetSchemeClassifier());
}
void TestingOmniboxView::UpdatePopup() {
@@ -208,7 +208,10 @@ void OmniboxViewViewsTest::SetUp() {
new chromeos::input_method::MockInputMethodManagerImpl);
#endif
omnibox_view_ = base::MakeUnique<TestingOmniboxView>(
- &omnibox_edit_controller_, &profile_, &command_updater_);
+ &omnibox_edit_controller_,
+ base::MakeUnique<ChromeOmniboxClient>(&omnibox_edit_controller_,
+ &profile_),
+ &command_updater_);
test_api_ = base::MakeUnique<views::TextfieldTestApi>(omnibox_view_.get());
omnibox_view_->Init();
}

Powered by Google App Engine
This is Rietveld 408576698