-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from brave/disable-url-tracker
Disable Chrome Google URL Tracker
- Loading branch information
Showing
6 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
chromium_src/chrome/browser/google/chrome_google_url_tracker_client.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* 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/. */ | ||
|
||
// This include is required here since chrome_google_url_tracker_client.cc | ||
// incldues it. We don't want replacements to happen though. | ||
// The header guard will ensure this even know the .cc includes it. | ||
#include "chrome/common/chrome_switches.h" | ||
|
||
// Required to declare kDisableChromeGoogleURLTrackingClient | ||
#include "brave/common/brave_switches.h" | ||
|
||
// The ChromeGooglURLTrackerClient will disable itself when the kDisableBackgroundNetworking | ||
// switch is set. Since several other services also disable themeselves when that is set, | ||
// we rename the switch that is used to something we define. | ||
#define kDisableBackgroundNetworking kDisableChromeGoogleURLTrackingClient | ||
#include "../../../../../chrome/browser/google/chrome_google_url_tracker_client.cc" | ||
#undef kDisableBackgroundNetworking |
18 changes: 18 additions & 0 deletions
18
chromium_src/chrome/browser/google/chrome_google_url_tracker_client_browsertest.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* 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/common/brave_switches.h" | ||
#include "chrome/browser/google/chrome_google_url_tracker_client.h" | ||
#include "chrome/browser/ui/browser.h" | ||
#include "chrome/test/base/in_process_browser_test.h" | ||
|
||
using BraveGoogleURLTrackerClientTest = InProcessBrowserTest; | ||
|
||
IN_PROC_BROWSER_TEST_F(BraveGoogleURLTrackerClientTest, DisablesGoogleURLTrackerClient) { | ||
EXPECT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
switches::kDisableChromeGoogleURLTrackingClient)); | ||
|
||
ChromeGoogleURLTrackerClient client(browser()->profile()); | ||
ASSERT_FALSE(client.IsBackgroundNetworkingEnabled()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters