Commit c73ed2e3 authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

Omnibox: Add QueryInOmnibox instance access to OmniboxClient

Desktop Omnibox component will need access to the profile-keyed
QueryInOmnibox service.

This can is provided by the embedder, so add its access to
OmniboxClient like the other embedder-provided profile-keyed services.

Bug: 874592
Change-Id: Ibc12b563a9d2fe7a2625cdc5fdc0d10bf85c45d7
Reviewed-on: https://chromium-review.googlesource.com/1208455
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589187}
parent 317deb56
......@@ -590,6 +590,8 @@ jumbo_split_static_library("ui") {
"login/login_interstitial_delegate.h",
"navigation_correction_tab_observer.cc",
"navigation_correction_tab_observer.h",
"omnibox/query_in_omnibox_factory.cc",
"omnibox/query_in_omnibox_factory.h",
"page_info/page_info.cc",
"page_info/page_info.h",
"page_info/page_info_ui.cc",
......@@ -1161,8 +1163,6 @@ jumbo_split_static_library("ui") {
"android/view_android_helper.cc",
"android/view_android_helper.h",
"browser_otr_state_android.cc",
"omnibox/query_in_omnibox_factory.cc",
"omnibox/query_in_omnibox_factory.h",
"screen_capture_notification_ui_stub.cc",
"webui/eoc_internals/eoc_internals_page_handler.cc",
"webui/eoc_internals/eoc_internals_page_handler.h",
......
......@@ -39,6 +39,7 @@
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h"
#include "chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h"
#include "chrome/browser/ui/omnibox/query_in_omnibox_factory.h"
#include "chrome/browser/ui/search/search_tab_helper.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/search/instant_types.h"
......@@ -222,6 +223,10 @@ AutocompleteClassifier* ChromeOmniboxClient::GetAutocompleteClassifier() {
return AutocompleteClassifierFactory::GetForProfile(profile_);
}
QueryInOmnibox* ChromeOmniboxClient::GetQueryInOmnibox() {
return QueryInOmniboxFactory::GetForProfile(profile_);
}
gfx::Image ChromeOmniboxClient::GetIconIfExtensionMatch(
const AutocompleteMatch& match) const {
TemplateURLService* service =
......
......@@ -49,6 +49,7 @@ class ChromeOmniboxClient : public OmniboxClient {
TemplateURLService* GetTemplateURLService() override;
const AutocompleteSchemeClassifier& GetSchemeClassifier() const override;
AutocompleteClassifier* GetAutocompleteClassifier() override;
QueryInOmnibox* GetQueryInOmnibox() override;
gfx::Image GetIconIfExtensionMatch(
const AutocompleteMatch& match) const override;
gfx::Image GetSizedIcon(const gfx::VectorIcon& vector_icon_type,
......
......@@ -73,6 +73,10 @@ AutocompleteClassifier* OmniboxClient::GetAutocompleteClassifier() {
return nullptr;
}
QueryInOmnibox* OmniboxClient::GetQueryInOmnibox() {
return nullptr;
}
gfx::Image OmniboxClient::GetIconIfExtensionMatch(
const AutocompleteMatch& match) const {
return gfx::Image();
......
......@@ -14,6 +14,7 @@
class AutocompleteResult;
class GURL;
class QueryInOmnibox;
class SessionID;
class TemplateURL;
class TemplateURLService;
......@@ -93,6 +94,7 @@ class OmniboxClient {
virtual TemplateURLService* GetTemplateURLService();
virtual const AutocompleteSchemeClassifier& GetSchemeClassifier() const = 0;
virtual AutocompleteClassifier* GetAutocompleteClassifier();
virtual QueryInOmnibox* GetQueryInOmnibox();
// Returns the icon corresponding to |match| if match is an extension match
// and an empty icon otherwise.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment