blob: 928faf6e1485d5f6d4d9a62df011f7f2ae4647c0 [file] [log] [blame]
// Copyright 2014 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_WEB_CHROME_WEB_CLIENT_H_
#define IOS_CHROME_BROWSER_WEB_CHROME_WEB_CLIENT_H_
#include "base/macros.h"
#include "ios/web/public/web_client.h"
// Chrome implementation of WebClient.
class ChromeWebClient : public web::WebClient {
public:
ChromeWebClient();
~ChromeWebClient() override;
// WebClient implementation.
web::WebMainParts* CreateWebMainParts() override;
void PreWebViewCreation() const override;
void AddAdditionalSchemes(std::vector<url::SchemeWithType>*
additional_standard_schemes) const override;
std::string GetAcceptLangs(web::BrowserState* state) const override;
std::string GetApplicationLocale() const override;
bool IsAppSpecificURL(const GURL& url) const override;
base::string16 GetPluginNotSupportedText() const override;
std::string GetProduct() const override;
std::string GetUserAgent(bool desktop_user_agent) const override;
base::string16 GetLocalizedString(int message_id) const override;
base::StringPiece GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override;
void GetAdditionalWebUISchemes(
std::vector<std::string>* additional_schemes) override;
void PostBrowserURLRewriterCreation(
web::BrowserURLRewriter* rewriter) override;
NSString* GetEarlyPageScript() const override;
void AllowCertificateError(
web::WebState* web_state,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
bool overridable,
const base::Callback<void(bool)>& callback) override;
void GetTaskSchedulerInitializationParams(
std::vector<base::SchedulerWorkerPoolParams>* params_vector,
base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
index_to_traits_callback) override;
void PerformExperimentalTaskSchedulerRedirections() override;
private:
DISALLOW_COPY_AND_ASSIGN(ChromeWebClient);
};
#endif // IOS_CHROME_BROWSER_WEB_CHROME_WEB_CLIENT_H_