Skip to content

Commit

Permalink
Remove const interfaces from content/public API.
Browse files Browse the repository at this point in the history
Bug: 908139
Tbr: boliu@chromium.org, bengr@chromium.org, seantopping@chromium.org, lazyboy@chromium.org, scottmg@chromium.org
Change-Id: I24a403afe5d7b5f5a58e4ac6f8d3d82eb23f2611
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1661149
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670246}
  • Loading branch information
lucasgadani authored and Commit Bot committed Jun 18, 2019
1 parent e9adecd commit 4909f3c
Show file tree
Hide file tree
Showing 80 changed files with 190 additions and 212 deletions.
8 changes: 4 additions & 4 deletions android_webview/browser/aw_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void AwContentBrowserClient::RenderProcessWillLaunch(
host->AddFilter(new cdm::CdmMessageFilterAndroid(true, false));
}

bool AwContentBrowserClient::ShouldUseMobileFlingCurve() const {
bool AwContentBrowserClient::ShouldUseMobileFlingCurve() {
return true;
}

Expand Down Expand Up @@ -1111,16 +1111,16 @@ void AwContentBrowserClient::WillCreateRestrictedCookieManager(
std::move(orig_request));
}

std::string AwContentBrowserClient::GetProduct() const {
std::string AwContentBrowserClient::GetProduct() {
return android_webview::GetProduct();
}

std::string AwContentBrowserClient::GetUserAgent() const {
std::string AwContentBrowserClient::GetUserAgent() {
return android_webview::GetUserAgent();
}

content::ContentBrowserClient::WideColorGamutHeuristic
AwContentBrowserClient::GetWideColorGamutHeuristic() const {
AwContentBrowserClient::GetWideColorGamutHeuristic() {
if (base::FeatureList::IsEnabled(features::kWebViewWideColorGamutSupport))
return WideColorGamutHeuristic::kUseWindow;
return WideColorGamutHeuristic::kNone;
Expand Down
8 changes: 4 additions & 4 deletions android_webview/browser/aw_content_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
void RenderProcessWillLaunch(
content::RenderProcessHost* host,
service_manager::mojom::ServiceRequest* service_request) override;
bool ShouldUseMobileFlingCurve() const override;
bool ShouldUseMobileFlingCurve() override;
bool IsHandledURL(const GURL& url) override;
bool ForceSniffingFileUrlsForHtml() override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
Expand Down Expand Up @@ -247,10 +247,10 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
int process_id,
int routing_id,
network::mojom::RestrictedCookieManagerRequest* request) override;
std::string GetProduct() const override;
std::string GetUserAgent() const override;
std::string GetProduct() override;
std::string GetUserAgent() override;
ContentBrowserClient::WideColorGamutHeuristic GetWideColorGamutHeuristic()
const override;
override;

AwFeatureListCreator* aw_feature_list_creator() {
return aw_feature_list_creator_;
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_web_contents_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void AwWebContentsDelegate::ExitFullscreenModeForTab(
}

bool AwWebContentsDelegate::IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const {
const content::WebContents* web_contents) {
return is_fullscreen_;
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_web_contents_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AwWebContentsDelegate
const blink::WebFullscreenOptions& options) override;
void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
bool IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const override;
const content::WebContents* web_contents) override;
void UpdateUserGestureCarryoverInfo(
content::WebContents* web_contents) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void TabWebContentsDelegateAndroid::Observe(
}

blink::WebDisplayMode TabWebContentsDelegateAndroid::GetDisplayMode(
const WebContents* web_contents) const {
const WebContents* web_contents) {
JNIEnv* env = base::android::AttachCurrentThread();

ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/tab_web_contents_delegate_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TabWebContentsDelegateAndroid
void CloseContents(content::WebContents* web_contents) override;
bool ShouldFocusLocationBarByDefault(content::WebContents* source) override;
blink::WebDisplayMode GetDisplayMode(
const content::WebContents* web_contents) const override;
const content::WebContents* web_contents) override;
void FindReply(content::WebContents* web_contents,
int request_id,
int number_of_matches,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestTabWebContentsDelegateAndroid
}

blink::WebDisplayMode GetDisplayMode(
const content::WebContents* web_contents) const override {
const content::WebContents* web_contents) override {
return display_mode_;
}

Expand Down
24 changes: 11 additions & 13 deletions chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ bool ChromeContentBrowserClient::
#endif
}

bool ChromeContentBrowserClient::ShouldUseMobileFlingCurve() const {
bool ChromeContentBrowserClient::ShouldUseMobileFlingCurve() {
#if defined(OS_ANDROID)
return true;
#elif defined(OS_CHROMEOS)
Expand Down Expand Up @@ -1680,7 +1680,7 @@ void ChromeContentBrowserClient::GetAdditionalViewSourceSchemes(
#endif
}

bool ChromeContentBrowserClient::LogWebUIUrl(const GURL& web_ui_url) const {
bool ChromeContentBrowserClient::LogWebUIUrl(const GURL& web_ui_url) {
return webui::LogWebUIUrl(web_ui_url);
}

Expand Down Expand Up @@ -3691,7 +3691,7 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(

#if defined(OS_WIN)
base::string16 ChromeContentBrowserClient::GetAppContainerSidForSandboxType(
int sandbox_type) const {
int sandbox_type) {
// TODO(wfh): Add support for more process types here. crbug.com/499523
switch (sandbox_type) {
case service_manager::SANDBOX_TYPE_RENDERER:
Expand Down Expand Up @@ -5624,21 +5624,19 @@ void ChromeContentBrowserClient::LogWebFeatureForCurrentPage(
render_frame_host, new_features);
}

std::string ChromeContentBrowserClient::GetProduct() const {
std::string ChromeContentBrowserClient::GetProduct() {
return ::GetProduct();
}

std::string ChromeContentBrowserClient::GetUserAgent() const {
std::string ChromeContentBrowserClient::GetUserAgent() {
return ::GetUserAgent();
}

blink::UserAgentMetadata ChromeContentBrowserClient::GetUserAgentMetadata()
const {
blink::UserAgentMetadata ChromeContentBrowserClient::GetUserAgentMetadata() {
return ::GetUserAgentMetadata();
}

base::Optional<gfx::ImageSkia> ChromeContentBrowserClient::GetProductLogo()
const {
base::Optional<gfx::ImageSkia> ChromeContentBrowserClient::GetProductLogo() {
// This icon is available on Android, but adds 19KiB to the APK. Since it
// isn't used on Android we exclude it to avoid bloat.
#if !defined(OS_ANDROID)
Expand Down Expand Up @@ -5680,7 +5678,7 @@ ui::AXMode ChromeContentBrowserClient::GetAXModeForBrowserContext(

#if defined(OS_ANDROID)
content::ContentBrowserClient::WideColorGamutHeuristic
ChromeContentBrowserClient::GetWideColorGamutHeuristic() const {
ChromeContentBrowserClient::GetWideColorGamutHeuristic() {
if (features::UseDisplayWideColorGamut()) {
return WideColorGamutHeuristic::kUseDisplay;
}
Expand All @@ -5704,7 +5702,7 @@ void ChromeContentBrowserClient::AugmentNavigationDownloadPolicy(
const content::WebContents* web_contents,
const content::RenderFrameHost* frame_host,
bool user_gesture,
content::NavigationDownloadPolicy* download_policy) const {
content::NavigationDownloadPolicy* download_policy) {
const ChromeSubresourceFilterClient* client =
ChromeSubresourceFilterClient::FromWebContents(web_contents);
if (client && client->GetThrottleManager()->IsFrameTaggedAsAd(frame_host)) {
Expand All @@ -5728,7 +5726,7 @@ void ChromeContentBrowserClient::AugmentNavigationDownloadPolicy(
bool ChromeContentBrowserClient::IsBluetoothScanningBlocked(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) const {
const url::Origin& embedding_origin) {
const HostContentSettingsMap* const content_settings =
HostContentSettingsMapFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
Expand All @@ -5746,7 +5744,7 @@ bool ChromeContentBrowserClient::IsBluetoothScanningBlocked(
void ChromeContentBrowserClient::BlockBluetoothScanning(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) const {
const url::Origin& embedding_origin) {
HostContentSettingsMap* const content_settings =
HostContentSettingsMapFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
Expand Down
33 changes: 15 additions & 18 deletions chrome/browser/chrome_content_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
bool is_main_frame,
const GURL& candidate_url,
const GURL& destination_url) override;
bool ShouldUseMobileFlingCurve() const override;
bool ShouldUseMobileFlingCurve() override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) override;
bool ShouldUseSpareRenderProcessHost(content::BrowserContext* browser_context,
Expand All @@ -165,7 +165,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
std::vector<std::string>* additional_schemes) override;
void GetAdditionalViewSourceSchemes(
std::vector<std::string>* additional_schemes) override;
bool LogWebUIUrl(const GURL& web_ui_url) const override;
bool LogWebUIUrl(const GURL& web_ui_url) override;
bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override;
bool IsHandledURL(const GURL& url) override;
bool CanCommitURL(content::RenderProcessHost* process_host,
Expand Down Expand Up @@ -393,8 +393,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_WIN)
bool PreSpawnRenderer(sandbox::TargetPolicy* policy) override;
base::string16 GetAppContainerSidForSandboxType(
int sandbox_type) const override;
base::string16 GetAppContainerSidForSandboxType(int sandbox_type) override;
#endif
void ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry,
Expand Down Expand Up @@ -578,11 +577,11 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
void LogWebFeatureForCurrentPage(content::RenderFrameHost* render_frame_host,
blink::mojom::WebFeature feature) override;

std::string GetProduct() const override;
std::string GetUserAgent() const override;
blink::UserAgentMetadata GetUserAgentMetadata() const override;
std::string GetProduct() override;
std::string GetUserAgent() override;
blink::UserAgentMetadata GetUserAgentMetadata() override;

base::Optional<gfx::ImageSkia> GetProductLogo() const override;
base::Optional<gfx::ImageSkia> GetProductLogo() override;

bool IsBuiltinComponent(content::BrowserContext* browser_context,
const url::Origin& origin) override;
Expand All @@ -595,7 +594,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {

#if defined(OS_ANDROID)
ContentBrowserClient::WideColorGamutHeuristic GetWideColorGamutHeuristic()
const override;
override;
#endif

base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
Expand All @@ -605,17 +604,15 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
const content::WebContents* web_contents,
const content::RenderFrameHost* frame_host,
bool user_gesture,
content::NavigationDownloadPolicy* download_policy) const override;
content::NavigationDownloadPolicy* download_policy) override;

bool IsBluetoothScanningBlocked(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) const override;
bool IsBluetoothScanningBlocked(content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) override;

void BlockBluetoothScanning(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) const override;
void BlockBluetoothScanning(content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) override;

content::PreviewsState DetermineAllowedPreviewsWithoutHoldback(
content::PreviewsState initial_state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ void ChromeDownloadManagerDelegate::CheckForFileExistence(
}

std::string
ChromeDownloadManagerDelegate::ApplicationClientIdForFileScanning() const {
ChromeDownloadManagerDelegate::ApplicationClientIdForFileScanning() {
return std::string(chrome::kApplicationClientIDStringForAVScanning);
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/download/chrome_download_manager_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ChromeDownloadManagerDelegate
void CheckForFileExistence(
download::DownloadItem* download,
content::CheckForFileExistenceCallback callback) override;
std::string ApplicationClientIdForFileScanning() const override;
std::string ApplicationClientIdForFileScanning() override;
void CheckDownloadAllowed(
const content::ResourceRequestInfo::WebContentsGetter&
web_contents_getter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void LookalikeUrlInterstitialPage::RecordUkmEvent(
}

content::InterstitialPageDelegate::TypeID
LookalikeUrlInterstitialPage::GetTypeForTesting() const {
LookalikeUrlInterstitialPage::GetTypeForTesting() {
return LookalikeUrlInterstitialPage::kTypeForTesting;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class LookalikeUrlInterstitialPage
~LookalikeUrlInterstitialPage() override;

// InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
InterstitialPageDelegate::TypeID GetTypeForTesting() override;

// Allow easier reporting of UKM when no interstitial is shown.
static void RecordUkmEvent(ukm::SourceId source_id,
Expand Down
7 changes: 3 additions & 4 deletions chrome/browser/media/offscreen_tab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ bool OffscreenTab::ShouldCreateWebContents(
return false;
}

bool OffscreenTab::EmbedsFullscreenWidget() const {
bool OffscreenTab::EmbedsFullscreenWidget() {
// OffscreenTab will manage fullscreen widgets.
return true;
}
Expand Down Expand Up @@ -330,14 +330,13 @@ void OffscreenTab::ExitFullscreenModeForTab(WebContents* contents) {
non_fullscreen_size_ = gfx::Size();
}

bool OffscreenTab::IsFullscreenForTabOrPending(
const WebContents* contents) const {
bool OffscreenTab::IsFullscreenForTabOrPending(const WebContents* contents) {
DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
return in_fullscreen_mode();
}

blink::WebDisplayMode OffscreenTab::GetDisplayMode(
const WebContents* contents) const {
const WebContents* contents) {
DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
return in_fullscreen_mode() ? blink::kWebDisplayModeFullscreen
: blink::kWebDisplayModeBrowser;
Expand Down
7 changes: 3 additions & 4 deletions chrome/browser/media/offscreen_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,15 @@ class OffscreenTab : protected content::WebContentsDelegate,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) final;
bool EmbedsFullscreenWidget() const final;
bool EmbedsFullscreenWidget() final;
void EnterFullscreenModeForTab(
content::WebContents* contents,
const GURL& origin,
const blink::WebFullscreenOptions& options) final;
void ExitFullscreenModeForTab(content::WebContents* contents) final;
bool IsFullscreenForTabOrPending(
const content::WebContents* contents) const final;
bool IsFullscreenForTabOrPending(const content::WebContents* contents) final;
blink::WebDisplayMode GetDisplayMode(
const content::WebContents* contents) const final;
const content::WebContents* contents) final;
void RequestMediaAccessPermission(
content::WebContents* contents,
const content::MediaStreamRequest& request,
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/prerender/prerender_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class PrerenderContents::WebContentsDelegateImpl
prerender_contents_->Destroy(FINAL_STATUS_REGISTER_PROTOCOL_HANDLER);
}

gfx::Size GetSizeForNewRenderView(WebContents* web_contents) const override {
gfx::Size GetSizeForNewRenderView(WebContents* web_contents) override {
// Have to set the size of the RenderView on initialization to be sure it is
// set before the RenderView is hidden on all platforms (esp. Android).
return prerender_contents_->bounds_.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void SafeBrowsingBlockingPage::HandleSubresourcesAfterProceed() {
}

content::InterstitialPageDelegate::TypeID
SafeBrowsingBlockingPage::GetTypeForTesting() const {
SafeBrowsingBlockingPage::GetTypeForTesting() {
return SafeBrowsingBlockingPage::kTypeForTesting;
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/safe_browsing/safe_browsing_blocking_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SafeBrowsingBlockingPage : public BaseBlockingPage {

// InterstitialPageDelegate method:
void OverrideRendererPrefs(blink::mojom::RendererPreferences* prefs) override;
content::InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
content::InterstitialPageDelegate::TypeID GetTypeForTesting() override;

protected:
friend class SafeBrowsingBlockingPageFactoryImpl;
Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/ssl/bad_clock_blocking_page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ bool BadClockBlockingPage::ShouldCreateNewNavigation() const {
return true;
}

InterstitialPageDelegate::TypeID BadClockBlockingPage::GetTypeForTesting()
const {
InterstitialPageDelegate::TypeID BadClockBlockingPage::GetTypeForTesting() {
return BadClockBlockingPage::kTypeForTesting;
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ssl/bad_clock_blocking_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BadClockBlockingPage : public SSLBlockingPageBase {
~BadClockBlockingPage() override;

// InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
InterstitialPageDelegate::TypeID GetTypeForTesting() override;

protected:
// InterstitialPageDelegate implementation:
Expand Down
Loading

0 comments on commit 4909f3c

Please sign in to comment.