Skip to content

Commit

Permalink
Merge pull request #98 from devjangid15/chromium
Browse files Browse the repository at this point in the history
Change url schema to Wootzapp:// from chrome://
  • Loading branch information
pandey019 authored Jul 11, 2024
2 parents 104d54a + 889d4d3 commit 13595a2
Show file tree
Hide file tree
Showing 258 changed files with 839 additions and 761 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@ public static String fixupOctothorpesInLoadDataContent(String data) {
return (UrlScheme.JAVASCRIPT_SCHEME);
} else if (url.startsWith("about:")) {
return (UrlScheme.ABOUT_SCHEME);
} else if (url.startsWith("chrome:")) {
} else if (url.startsWith("wootzapp:")) {
return (UrlScheme.CHROME_SCHEME);
} else if (url.startsWith("blob:")) {
return (UrlScheme.BLOB_SCHEME);
Expand Down
2 changes: 1 addition & 1 deletion src/build/android/adb_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def main():
'''
parser.add_argument('--name', required=True,
help='Name of file where to store flags on the device.')
parser.add_argument('-e', '--executable', dest='executable', default='chrome',
parser.add_argument('-e', '--executable', dest='executable', default='wootzapp',
help='(deprecated) No longer used.')
script_common.AddEnvironmentArguments(parser)
script_common.AddDeviceArguments(parser)
Expand Down
19 changes: 0 additions & 19 deletions src/chrome/android/java/res/xml/about_chrome_preferences.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public LoadUrlResult loadUrl(LoadUrlParams params) {
}
}

if ("chrome://java-crash/".equals(params.getUrl())) {
if ("wootzapp://java-crash/".equals(params.getUrl())) {
return handleJavaCrash();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
@Config(manifest = Config.NONE)
public class IntentHandlerRobolectricTest {
private static final String[] ACCEPTED_NON_HTTP_AND_HTTPS_URLS = {
"chrome://newtab",
"wootzapp://newtab",
"file://foo.txt",
"ftp://www.foo.com",
"",
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/browser/allocation_recorder_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ AllocationRecorderBrowserTest::AllocationRecorderBrowserTest() = default;
AllocationRecorderBrowserTest::~AllocationRecorderBrowserTest() = default;

void AllocationRecorderBrowserTest::CrashRendererProcess() {
const GURL crash_url("chrome://crash");
const GURL crash_url("wootzapp://crash");

auto* const web_contents = chrome_test_utils::GetActiveWebContents(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ TEST_F(AuxiliarySearchProviderTest, QueryBookmarks_nativePageShouldBeFiltered) {
GURL(chrome::kChromeUINativeNewTabURL),
GURL("content://content_url"),
GURL("about:about_url"),
GURL("chrome://chrome_url"),
GURL("wootzapp://wootzapp_url"),
GURL("javascript:javascript_url"),
GURL("file://file_url"),
GURL("invalidscheme://invalidscheme_url")};
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/browser/bad_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void LogBadMessage(BadMessageReason reason) {

void ReceivedBadMessage(content::RenderProcessHost* host,
BadMessageReason reason) {
TRACE_EVENT_INSTANT2("ipc,security", "chrome::ReceivedBadMessage",
TRACE_EVENT_INSTANT2("ipc,security", "wootzapp::ReceivedBadMessage",
TRACE_EVENT_SCOPE_THREAD, "reason", reason,
"render_process_host", host);
LogBadMessage(reason);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ TEST_F(BookmarkBridgeTest, TestMoveBookmarkToReadingList) {
}

TEST_F(BookmarkBridgeTest, TestMoveBookmarkToReadingListAddFails) {
GURL url = GURL("chrome://newtab");
GURL url = GURL("wootzapp://newtab");
const std::u16string title = u"native page";

const BookmarkNode* node =
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/browser/browser_about_handler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TEST_F(BrowserAboutHandlerTest,
GURL history_foo_url(
GURL(chrome::kChromeUIHistoryURL).ReplaceComponents(replace_foo_query));
TestHandleChromeAboutAndChromeSyncRewrite(std::vector<AboutURLTestCase>({
{GURL("chrome:history"), GURL(chrome::kChromeUIHistoryURL)},
{GURL("wootzapp:history"), GURL(chrome::kChromeUIHistoryURL)},
{GURL(chrome::kChromeUIHistoryURL), GURL(chrome::kChromeUIHistoryURL)},
{history_foo_url, history_foo_url},
}));
Expand Down
8 changes: 4 additions & 4 deletions src/chrome/browser/chrome_content_browser_client_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,16 @@ TEST_F(ChromeContentBrowserClientWindowTest, ShouldStayInParentProcessForNTP) {
EXPECT_FALSE(client.ShouldStayInParentProcessForNTP(
GURL("chrome-search://foo/"), site_instance->GetSiteURL()));
EXPECT_FALSE(client.ShouldStayInParentProcessForNTP(
GURL("chrome://new-tab-page"), site_instance->GetSiteURL()));
GURL("wootzapp://new-tab-page"), site_instance->GetSiteURL()));

site_instance = content::SiteInstance::CreateForURL(
browser()->profile(), GURL("chrome://new-tab-page"));
browser()->profile(), GURL("wootzapp://new-tab-page"));

// chrome://new-tab-page is an NTP replacing local-ntp and supports OOPIFs.
// ShouldStayInParentProcessForNTP() should only return true for NTPs hosted
// under the chrome-search: scheme.
EXPECT_FALSE(client.ShouldStayInParentProcessForNTP(
GURL("chrome://new-tab-page"), site_instance->GetSiteURL()));
GURL("wootzapp://new-tab-page"), site_instance->GetSiteURL()));

// For now, we also allow chrome-search://most-visited to stay in 1P NTP,
// chrome://new-tab-page. We should consider tightening this to only allow
Expand Down Expand Up @@ -957,7 +957,7 @@ TEST_F(ChromeContentSettingsRedirectTest, RedirectHelpURL) {
const GURL help_url(chrome::kChromeUIHelpURL);
GURL dest_url = help_url;
test_content_browser_client.HandleWebUI(&dest_url, &profile_);
EXPECT_EQ(GURL("chrome://settings/help"), dest_url);
EXPECT_EQ(GURL("wootzapp://settings/help"), dest_url);

base::Value::List list;
list.Append(static_cast<int>(policy::SystemFeature::kBrowserSettings));
Expand Down
4 changes: 2 additions & 2 deletions src/chrome/browser/chrome_security_exploit_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityExploitBrowserTest,
std::string payload_type = "text/html";

// Target an extension.
std::string target_origin = "chrome://downloads";
std::string target_origin = "wootzapp://downloads";

// Set up a blob ID and populate it with the attacker-controlled payload. This
// is just using the blob APIs directly since creating arbitrary blobs is not
Expand Down Expand Up @@ -544,7 +544,7 @@ IN_PROC_BROWSER_TEST_P(ChromeSecurityExploitBrowserTestMojoBlobURLsP,
std::string blob_path = "f7dfbeb5-8e41-4c4a-8486-a52fed33c4c0";

// Target an extension.
std::string target_origin = "chrome://downloads";
std::string target_origin = "wootzapp://downloads";

base::RepeatingCallback<void(storage::BlobUrlRegistry*, mojo::ReceiverId)>
blob_url_registry_intercept_hook;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ TEST_F(CompanionUrlBuilderTest, NonProtobufParams) {

TEST_F(CompanionUrlBuilderTest, ValidPageUrls) {
VerifyPageUrlSent(GURL(kValidUrl), true);
VerifyPageUrlSent(GURL("chrome://new-tab"), false);
VerifyPageUrlSent(GURL("wootzapp://new-tab"), false);
VerifyPageUrlSent(GURL("https://192.168.0.1"), false);
VerifyPageUrlSent(GURL("https://localhost:8888"), false);
}
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/browser/companion/core/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ bool IsSafeURLFromCompanion(const GURL& url) {
}

static constexpr auto chrome_domain_allowlists =
base::MakeFixedFlatSet<std::string_view>({"chrome://settings/syncSetup"});
base::MakeFixedFlatSet<std::string_view>({"wootzapp://settings/syncSetup"});
std::string_view url_string(url.spec());

if (!url.SchemeIsHTTPOrHTTPS() &&
Expand Down
4 changes: 2 additions & 2 deletions src/chrome/browser/companion/core/utils_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ TEST_F(CompanionCoreUtilsTest, ImageUploadURLForCompanion) {

TEST_F(CompanionCoreUtilsTest, IsSafeURLFromCompanion) {
EXPECT_TRUE(IsSafeURLFromCompanion(GURL("https://www.google.com/")));
EXPECT_TRUE(IsSafeURLFromCompanion(GURL("chrome://settings/syncSetup")));
EXPECT_TRUE(IsSafeURLFromCompanion(GURL("wootzapp://settings/syncSetup")));
EXPECT_FALSE(IsSafeURLFromCompanion(GURL("chrome-untrusted://terminal")));
EXPECT_FALSE(IsSafeURLFromCompanion(GURL("chrome://history")));
EXPECT_FALSE(IsSafeURLFromCompanion(GURL("wootzapp://history")));
EXPECT_FALSE(IsSafeURLFromCompanion(
GURL("data:text/html,<script>window.location.href = "
"\"https://www.maliciousurl.com\";</script>")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ constexpr char kURL2[] = "http://youtube.com/";
constexpr char kSiteMutedEvent[] = "Media.SiteMuted";
constexpr char kSiteMutedReason[] = "MuteReason";
#if !BUILDFLAG(IS_ANDROID)
constexpr char kChromeURL[] = "chrome://dino";
constexpr char kChromeURL[] = "wootzapp://dino";
constexpr char kExtensionId[] = "extensionid";
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ TEST_F(DevUiLoaderThrottleTest, PreventAccidentalInclusion) {
auto ShouldInstallDevUiDfm = DevUiLoaderThrottle::ShouldInstallDevUiDfm;

// Useful to have the catalog always.
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("chrome://chrome-urls")));
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("chrome://about")));
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("wootzapp://wootzapp-urls")));
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("wootzapp://about")));
// Inclusion in base module is mandatory.
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("chrome://credits")));
// Well-loved game, and shown when there's no internet (cannot install DFM).
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("chrome://dino")));
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("wootzapp://dino")));
// chrome://flags has relatively high usage.
EXPECT_FALSE(ShouldInstallDevUiDfm(GURL("chrome://flags")));
// Useful for filing bugs.
Expand Down
6 changes: 3 additions & 3 deletions src/chrome/browser/devtools/devtools_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, MAYBE_CantInspectNewTabPage) {
LoadExtension("can_inspect_url");
RunTest("waitForTestResultsAsMessage",
base::StrCat({kArbitraryPage, "#chrome://newtab/"}));
base::StrCat({kArbitraryPage, "#wootzapp://newtab/"}));
}

// TODO(crbug.com/40943634): Re-enable the test once it is fixed.
Expand Down Expand Up @@ -2986,8 +2986,8 @@ IN_PROC_BROWSER_TEST_F(DevToolsTest, MAYBE_TestOpenInNewTabFilter) {
{"view-source:http://chromium.org", "about:blank"},
{"file:///", "about:blank"},
{"about://gpu", "about:blank"},
{"chrome://gpu", "about:blank"},
{"chrome://crash", "about:blank"},
{"wootzapp://gpu", "about:blank"},
{"wootzapp://crash", "about:blank"},
{"", "about:blank"},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ using offline_items_collection::FailState;
namespace {

const char kDownloadNotificationNotifierId[] =
"chrome://downloads/notification/id-notifier";
"wootzapp://downloads/notification/id-notifier";

const char kDownloadNotificationOrigin[] = "chrome://downloads";
const char kDownloadNotificationOrigin[] = "wootzapp://downloads";

// Background color of the preview images
const SkColor kImageBackgroundColor = SK_ColorWHITE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ TEST_F(ImportantSitesUtilTest, ExcludeNonRegisterableDomains) {
ASSERT_TRUE(service);

GURL url1("http://www.google.com/");
GURL url2("chrome://newtab/");
GURL url3("chrome://settings/");
GURL url2("wootzapp://newtab/");
GURL url3("wootzapp://settings/");
GURL url4("http://localhost/");

// Set a bunch of positive signals.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ TEST_F(SiteEngagementServiceTest, GetAllDetailsIncludesBonusOnlyScores) {

TEST_F(SiteEngagementServiceTest, GetAllDetailsFilterByURLSets) {
GURL http_url("http://www.google.com/");
GURL webui_url("chrome://history");
GURL webui_url("wootzapp://history");

EXPECT_EQ(0u, service_->GetAllDetails().size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class ConnectorsServiceExemptURLsTest
TEST_P(ConnectorsServiceExemptURLsTest, WebUI) {
auto* service = ConnectorsServiceFactory::GetForBrowserContext(profile_);
for (const char* url :
{"chrome://settings", "chrome://help-app/background",
{"wootzapp://settings", "wootzapp://help-app/background",
"chrome://foo/bar/baz.html", "chrome://foo/bar/baz.html?param=value"}) {
auto settings = service->GetAnalysisSettings(GURL(url), connector());
ASSERT_FALSE(settings.has_value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ TEST_F(BookmarkManagerPrivateApiUnitTest,
TEST_F(BookmarkManagerPrivateApiUnitTest,
RunOpenInNewWindowFunctionIncognitoIncompatibleNode) {
const bookmarks::BookmarkNode* node = model()->AddURL(
model()->other_node(), 0, u"history", GURL("chrome://history"));
model()->other_node(), 0, u"history", GURL("wootzapp://history"));
std::string node_id = base::NumberToString(node->id());

auto new_window_function =
base::MakeRefCounted<BookmarkManagerPrivateOpenInNewWindowFunction>();
std::string args = base::StringPrintf(R"([["%s"], true])", node_id.c_str());
EXPECT_EQ("Cannot open URL \"chrome://history/\" in an incognito window.",
EXPECT_EQ("Cannot open URL \"wootzapp://history/\" in an incognito window.",
api_test_utils::RunFunctionAndReturnError(new_window_function.get(),
args, profile()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ IN_PROC_BROWSER_TEST_P(CookiesApiTest, CookiesEventsSpanning) {
// incognito cookie store. Otherwise, the chrome.cookies.set operation is just
// ignored and we won't be notified about a newly set cookie for which we want
// to test whether the storeId is set correctly.
OpenURLOffTheRecord(browser()->profile(), GURL("chrome://newtab/"));
OpenURLOffTheRecord(browser()->profile(), GURL("wootzapp://newtab/"));
ASSERT_TRUE(RunTest("cookies/events_spanning",
/*allow_in_incognito=*/true))
<< message_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ IN_PROC_BROWSER_TEST_F(DebuggerApiTest,
DebuggerNotAllowedOnRestrictedBlobUrls) {
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(content::NavigateToURL(web_contents, GURL("chrome://settings")));
EXPECT_TRUE(content::NavigateToURL(web_contents, GURL("wootzapp://settings")));
EXPECT_TRUE(content::WaitForLoadStop(web_contents));
ASSERT_TRUE(content::ExecJs(web_contents, R"(
var blob = new Blob([JSON.stringify({foo: 'bar'})], {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ TEST_F(DeveloperPrivateApiUnitTest, GrantHostPermission) {
/*should_succeed=*/false, kInvalidHostError);

// Cannot grant chrome:-scheme URLs.
GURL chrome_host("chrome://settings/*");
GURL chrome_host("wootzapp://settings/*");
RunAddHostPermission(profile(), *extension, chrome_host.spec(),
/*should_succeed=*/false, kInvalidHostError);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest,
listener.set_extension_id(extension->id());

Browser* incognito_browser =
OpenURLOffTheRecord(profile(), GURL("chrome://newtab/"));
OpenURLOffTheRecord(profile(), GURL("wootzapp://newtab/"));
EXPECT_TRUE(listener.WaitUntilSatisfied());
EXPECT_EQ(std::string("opened"), listener.message());
auto test_util = ExtensionActionTestHelper::Create(incognito_browser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ IN_PROC_BROWSER_TEST_P(MultiActionAPICanvasTest, DISABLED_DynamicSetIcon) {

// Create a new tab.
ui_test_utils::NavigateToURLWithDisposition(
browser(), GURL("chrome://newtab"),
browser(), GURL("wootzapp://newtab"),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP);

Expand Down Expand Up @@ -1276,7 +1276,7 @@ IN_PROC_BROWSER_TEST_P(MultiActionAPITest, GettersAndSetters) {

// And a second new tab.
ui_test_utils::NavigateToURLWithDisposition(
browser(), GURL("chrome://newtab"),
browser(), GURL("wootzapp://newtab"),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP);
int second_tab_id = GetActiveTabId();
Expand Down Expand Up @@ -1493,7 +1493,7 @@ IN_PROC_BROWSER_TEST_P(MultiActionAPITest, EnableAndDisable) {
browser()->tab_strip_model()->GetActiveWebContents();

ui_test_utils::NavigateToURLWithDisposition(
browser(), GURL("chrome://newtab"),
browser(), GURL("wootzapp://newtab"),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP);

Expand Down Expand Up @@ -1798,7 +1798,7 @@ IN_PROC_BROWSER_TEST_P(ActionAndBrowserActionAPITest,
EnsureActionIsEnabledOnTab(action, tab_id1);

ui_test_utils::NavigateToURLWithDisposition(
browser(), GURL("chrome://newtab"),
browser(), GURL("wootzapp://newtab"),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ TEST_F(PermissionsAPIUnitTest, RequestingChromeURLs) {
.Build();
AddExtensionAndGrantPermissions(*extension);

const GURL chrome_url("chrome://settings");
const GURL chrome_url("wootzapp://settings");

// By default, the extension should not have access to chrome://settings.
EXPECT_FALSE(extension->permissions_data()->HasHostPermission(chrome_url));
Expand All @@ -667,7 +667,7 @@ TEST_F(PermissionsAPIUnitTest, RequestingChromeURLs) {
function->set_user_gesture(true);
function->set_extension(extension.get());
std::string error = api_test_utils::RunFunctionAndReturnError(
function.get(), R"([{"origins": ["chrome://settings/*"]}])", profile(),
function.get(), R"([{"origins": ["wootzapp://settings/*"]}])", profile(),
api_test_utils::FunctionMode::kNone);
EXPECT_EQ(kNotInManifestError, error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,22 +305,22 @@ class ControlledPrefsNotifyWhenNeeded : public ExtensionControlledPrefsTest {
EXPECT_CALL(observer, OnPreferenceChanged(_));
EXPECT_CALL(incognito_observer, OnPreferenceChanged(_));
InstallExtensionControlledPref(extension1(), kPref1,
base::Value("chrome://newtab"));
base::Value("wootzapp://newtab"));
Mock::VerifyAndClearExpectations(&observer);
Mock::VerifyAndClearExpectations(&incognito_observer);
// Change only incognito persistent value.
EXPECT_CALL(observer, OnPreferenceChanged(_)).Times(0);
EXPECT_CALL(incognito_observer, OnPreferenceChanged(_));
InstallExtensionControlledPrefIncognito(extension1(), kPref1,
base::Value("chrome://newtab2"));
base::Value("wootzapp://newtab2"));
Mock::VerifyAndClearExpectations(&observer);
Mock::VerifyAndClearExpectations(&incognito_observer);

// Change only incognito session-only value.
EXPECT_CALL(observer, OnPreferenceChanged(_)).Times(0);
EXPECT_CALL(incognito_observer, OnPreferenceChanged(_));
InstallExtensionControlledPrefIncognito(extension1(), kPref1,
base::Value("chrome://newtab3"));
base::Value("wootzapp://newtab3"));
Mock::VerifyAndClearExpectations(&observer);
Mock::VerifyAndClearExpectations(&incognito_observer);

Expand Down
Loading

0 comments on commit 13595a2

Please sign in to comment.