blob: ca4c7e926f0a471f8421edd947bcabb35eb4ba6e [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_OMNIBOX_CHROME_OMNIBOX_CLIENT_IOS_H_
#define IOS_CHROME_BROWSER_UI_OMNIBOX_CHROME_OMNIBOX_CLIENT_IOS_H_
#include <memory>
#include "base/compiler_specific.h"
#include "components/omnibox/browser/omnibox_client.h"
#include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h"
class ChromeBrowserState;
class WebOmniboxEditController;
class ChromeOmniboxClientIOS : public OmniboxClient {
public:
ChromeOmniboxClientIOS(WebOmniboxEditController* controller,
ChromeBrowserState* browser_state);
~ChromeOmniboxClientIOS() override;
// OmniboxClient.
std::unique_ptr<AutocompleteProviderClient> CreateAutocompleteProviderClient()
override;
std::unique_ptr<OmniboxNavigationObserver> CreateOmniboxNavigationObserver(
const std::u16string& text,
const AutocompleteMatch& match,
const AutocompleteMatch& alternate_nav_match) override;
bool CurrentPageExists() const override;
const GURL& GetURL() const override;
bool IsLoading() const override;
bool IsPasteAndGoEnabled() const override;
bool IsDefaultSearchProviderEnabled() const override;
const SessionID& GetSessionID() const override;
bookmarks::BookmarkModel* GetBookmarkModel() override;
TemplateURLService* GetTemplateURLService() override;
const AutocompleteSchemeClassifier& GetSchemeClassifier() const override;
AutocompleteClassifier* GetAutocompleteClassifier() override;
bool ShouldDefaultTypedNavigationsToHttps() const override;
int GetHttpsPortForTesting() const override;
gfx::Image GetIconIfExtensionMatch(
const AutocompleteMatch& match) const override;
bool ProcessExtensionKeyword(const TemplateURL* template_url,
const AutocompleteMatch& match,
WindowOpenDisposition disposition,
OmniboxNavigationObserver* observer) override;
void OnFocusChanged(OmniboxFocusState state,
OmniboxFocusChangeReason reason) override;
void OnResultChanged(const AutocompleteResult& result,
bool default_match_changed,
const BitmapFetchedCallback& on_bitmap_fetched) override;
void OnURLOpenedFromOmnibox(OmniboxLog* log) override;
void DiscardNonCommittedNavigations() override;
const std::u16string& GetTitle() const override;
gfx::Image GetFavicon() const override;
private:
WebOmniboxEditController* controller_;
ChromeBrowserState* browser_state_;
AutocompleteSchemeClassifierImpl scheme_classifier_;
DISALLOW_COPY_AND_ASSIGN(ChromeOmniboxClientIOS);
};
#endif // IOS_CHROME_BROWSER_UI_OMNIBOX_CHROME_OMNIBOX_CLIENT_IOS_H_