Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Jan 22, 2019
1 parent 742129b commit 0c92190
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 27 deletions.
44 changes: 28 additions & 16 deletions browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/browser/brave_content_browser_client.h"

#include <string>
#include <utility>

#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/task/post_task.h"
Expand Down Expand Up @@ -43,6 +47,7 @@
#include "ui/base/resource/resource_bundle.h"

using content::BrowserThread;
using content::ContentBrowserClient;
using content::RenderFrameHost;
using content::WebContents;
using brave_shields::BraveShieldsWebContentsObserver;
Expand Down Expand Up @@ -112,16 +117,16 @@ bool HandleURLRewrite(GURL* url,

} // namespace

BraveContentBrowserClient::BraveContentBrowserClient(ChromeFeatureListCreator* chrome_feature_list_creator) :
ChromeContentBrowserClient(chrome_feature_list_creator)
{}
BraveContentBrowserClient::BraveContentBrowserClient(
ChromeFeatureListCreator* chrome_feature_list_creator)
: ChromeContentBrowserClient(chrome_feature_list_creator) {}

BraveContentBrowserClient::~BraveContentBrowserClient() {}

content::BrowserMainParts* BraveContentBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) {
ChromeBrowserMainParts* main_parts = (ChromeBrowserMainParts*)
ChromeContentBrowserClient::CreateBrowserMainParts(parameters);
ChromeBrowserMainParts* main_parts = static_cast<ChromeBrowserMainParts*>(
ChromeContentBrowserClient::CreateBrowserMainParts(parameters));
main_parts->AddParts(new BraveBrowserMainExtraParts());
return main_parts;
}
Expand All @@ -139,8 +144,12 @@ void BraveContentBrowserClient::BrowserURLHandlerCreated(
&HandleURLReverseOverrideRewrite);
}

bool BraveContentBrowserClient::AllowAccessCookie(const GURL& url, const GURL& first_party,
content::ResourceContext* context, int render_process_id, int render_frame_id) {
bool BraveContentBrowserClient::AllowAccessCookie(
const GURL& url,
const GURL& first_party,
content::ResourceContext* context,
int render_process_id,
int render_frame_id) {
GURL tab_origin =
BraveShieldsWebContentsObserver::GetTabURLFromRenderFrameInfo(
render_process_id, render_frame_id, -1).GetOrigin();
Expand Down Expand Up @@ -194,7 +203,7 @@ BraveContentBrowserClient::AllowWebBluetooth(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) {
return content::ContentBrowserClient::AllowWebBluetoothResult::BLOCK_GLOBALLY_DISABLED;
return ContentBrowserClient::AllowWebBluetoothResult::BLOCK_GLOBALLY_DISABLED;
}

bool BraveContentBrowserClient::HandleExternalProtocol(
Expand All @@ -213,7 +222,8 @@ bool BraveContentBrowserClient::HandleExternalProtocol(
}

return ChromeContentBrowserClient::HandleExternalProtocol(
url, web_contents_getter, child_id, navigation_data, is_main_frame, page_transition, has_user_gesture, method, headers);
url, web_contents_getter, child_id, navigation_data, is_main_frame,
page_transition, has_user_gesture, method, headers);
}

void BraveContentBrowserClient::RegisterOutOfProcessServices(
Expand Down Expand Up @@ -242,7 +252,6 @@ BraveContentBrowserClient::GetNavigationUIData(
TorProfileServiceFactory::SetTorNavigationUIData(profile,
navigation_ui_data.get());
return std::move(navigation_ui_data);

}

std::unique_ptr<base::Value>
Expand Down Expand Up @@ -310,11 +319,14 @@ void BraveContentBrowserClient::MaybeHideReferrer(
GURL(),
CONTENT_SETTINGS_TYPE_PLUGINS,
brave_shields::kBraveShields);
brave_shields::ShouldSetReferrer(allow_referrers, shields_up,
referrer->url, document_url, request_url,
request_url.GetOrigin(),
referrer->policy,
referrer);
brave_shields::ShouldSetReferrer(allow_referrers,
shields_up,
referrer->url,
document_url,
request_url,
request_url.GetOrigin(),
referrer->policy,
referrer);
}

GURL BraveContentBrowserClient::GetEffectiveURL(
Expand Down
5 changes: 3 additions & 2 deletions browser/brave_content_browser_client_browsertest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

Expand Down Expand Up @@ -419,7 +420,7 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest,

class BraveContentBrowserClientReferrerTest
: public BraveContentBrowserClientTest {
public:
public:
HostContentSettingsMap* content_settings() {
return HostContentSettingsMapFactory::GetForProfile(browser()->profile());
}
Expand Down
6 changes: 4 additions & 2 deletions browser/ui/webui/brave_web_ui_controller_factory.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/browser/ui/webui/brave_web_ui_controller_factory.h"

#include <memory>

#include "brave/browser/ui/webui/brave_adblock_ui.h"
#include "brave/browser/ui/webui/brave_md_settings_ui.h"
#include "brave/browser/ui/webui/brave_new_tab_ui.h"
Expand Down Expand Up @@ -85,7 +88,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,

WebUI::TypeID BraveWebUIControllerFactory::GetWebUIType(
content::BrowserContext* browser_context, const GURL& url) const {

WebUIFactoryFunction function = GetWebUIFactoryFunction(NULL, url);
if (function) {
return reinterpret_cast<WebUI::TypeID>(function);
Expand Down
3 changes: 2 additions & 1 deletion browser/ui/webui/brave_welcome_ui_browsertest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

Expand Down
5 changes: 3 additions & 2 deletions chromium_src/chrome/browser/browser_about_handler.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#define FixupBrowserAboutURL FixupBrowserAboutURL_ChromiumImpl
#include "../../../../chrome/browser/browser_about_handler.cc"
#include "../../../../chrome/browser/browser_about_handler.cc" // NOLINT
#undef FixupBrowserAboutURL

#include "brave/common/url_constants.h"
Expand Down
8 changes: 5 additions & 3 deletions chromium_src/chrome/browser/ui/browser.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

Expand All @@ -7,8 +8,9 @@
#include "brave/browser/ui/brave_browser_content_setting_bubble_model_delegate.h"
#include "brave/browser/ui/brave_browser_command_controller.h"

#define BrowserContentSettingBubbleModelDelegate BraveBrowserContentSettingBubbleModelDelegate
#define BrowserContentSettingBubbleModelDelegate
BraveBrowserContentSettingBubbleModelDelegate
#define BrowserCommandController BraveBrowserCommandController
#include "../../../../../chrome/browser/ui/browser.cc"
#include "../../../../../chrome/browser/ui/browser.cc" // NOLINT
#undef BrowserContentSettingBubbleModelDelegate
#undef BrowserCommandController
3 changes: 2 additions & 1 deletion common/webui_url_constants.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

Expand Down
5 changes: 5 additions & 0 deletions common/webui_url_constants.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef BRAVE_COMMON_WEBUI_URL_CONSTANTS_H_
#define BRAVE_COMMON_WEBUI_URL_CONSTANTS_H_

Expand Down

0 comments on commit 0c92190

Please sign in to comment.