Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change brave://bravesync to brave://sync #1047

Merged
merged 1 commit into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@ bool HandleURLRewrite(GURL* url,
*url = GURL(kBraveUIWelcomeURL);
return true;
}
if (url->SchemeIs(content::kChromeUIScheme) &&
(url->host() == kBraveUISyncHost)) {
*url = GURL(kBraveUISyncURL);
return true;
}

return false;
}

bool HandleURLReverseRewrite(GURL* url,
content::BrowserContext* browser_context) {
if (url->spec() == kBraveUIWelcomeURL) {
if (url->spec() == kBraveUIWelcomeURL ||
url->spec() == kBraveUISyncURL) {
return true;
}
return false;
Expand Down
3 changes: 2 additions & 1 deletion browser/brave_content_browser_client_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadCustomBravePages) {
#if BUILDFLAG(BRAVE_REWARDS_ENABLED)
GURL("chrome://rewards/"),
#endif
GURL("chrome://welcome/")
GURL("chrome://welcome/"),
GURL("chrome://sync/")
};
std::for_each(urls.begin(), urls.end(), [this](const GURL& url) {
content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
Expand Down
2 changes: 1 addition & 1 deletion browser/profiles/brave_profile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void BraveProfileManager::DoFinalInitForServices(Profile* profile,
bool go_off_the_record) {
ProfileManager::DoFinalInitForServices(profile, go_off_the_record);
// BraveSyncService need to be created when profile initialized, otherwise
// it will only be constructed only when we open chrome://bravesync
// it will only be constructed only when we open chrome:/sync/
brave_sync::BraveSyncServiceFactory::GetForProfile(profile);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</style>
<div class="settings-box">
<div class="start">
$i18n{braveSyncLabel} <a href="brave://bravesync" target="_blank">brave://bravesync</a>
$i18n{braveSyncLabel} <a href="brave://sync" target="_blank">brave://sync</a>
</div>
</div>
</template>
Expand Down
3 changes: 1 addition & 2 deletions browser/ui/webui/brave_web_ui_controller_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ WebUIController* NewWebUI<BasicUI>(WebUI* web_ui, const GURL& url) {
auto host = url.host_piece();
if (host == kBraveUISyncHost && brave_sync::BraveSyncService::is_enabled()) {
return new SyncUI(web_ui, url.host());
} else
if (host == kAdblockHost) {
} else if (host == kAdblockHost) {
return new BraveAdblockUI(web_ui, url.host());
#if BUILDFLAG(BRAVE_REWARDS_ENABLED)
} else if (host == kRewardsHost) {
Expand Down
2 changes: 1 addition & 1 deletion browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void CustomizeWebUIHTMLSource(const std::string &name, content::WebUIDataSource*
{ "yourWallet", IDS_BRAVE_UI_YOUR_WALLET }
}
}, {
std::string("bravesync"), {
std::string("sync"), {
{ "sync", IDS_BRAVE_SYNC_TITLE },
{ "beta", IDS_BRAVE_SYNC_TITLE_BETA },
{ "syncInfo1", IDS_BRAVE_SYNC_INFO_1 },
Expand Down
4 changes: 2 additions & 2 deletions common/webui_url_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const char kWelcomeJS[] = "brave_welcome.js";
const char kDonateHost[] = "donate";
const char kDonateJS[] = "brave_donate.js";
const char kBraveNewTabJS[] = "brave_new_tab.js";
const char kBraveUISyncHost[] = "bravesync";
const char kBraveUISyncHost[] = "sync";
const char kBraveSyncJS[] = "brave_sync.js";
const char kBraveUIWelcomeURL[] = "chrome://welcome/";
const char kBraveUIRewardsURL[] = "chrome://rewards/";
const char kBraveUIAdblockURL[] = "chrome://adblock/";
const char kBraveUIDonateURL[] = "chrome://donate/";
const char kBraveUISyncURL[] = "chrome://bravesync";
const char kBraveUISyncURL[] = "chrome://sync/";