-
Notifications
You must be signed in to change notification settings - Fork 879
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 #2033 from /issues/3411-0.63.x
Merge pull request #2024 from /issues/3411
- Loading branch information
Showing
12 changed files
with
139 additions
and
46 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
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
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,32 @@ | ||
/* 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/toolbar/brave_location_bar_model_delegate.h" | ||
|
||
#include "base/strings/utf_string_conversions.h" | ||
|
||
BraveLocationBarModelDelegate::BraveLocationBarModelDelegate( | ||
Browser* browser) : BrowserLocationBarModelDelegate(browser) {} | ||
|
||
BraveLocationBarModelDelegate::~BraveLocationBarModelDelegate() {} | ||
|
||
base::string16 | ||
BraveLocationBarModelDelegate::FormattedStringWithEquivalentMeaning( | ||
const GURL& url, | ||
const base::string16& formatted_url) const { | ||
base::string16 new_formatted_url = | ||
BrowserLocationBarModelDelegate::FormattedStringWithEquivalentMeaning( | ||
url, formatted_url); | ||
|
||
if (url.SchemeIs("chrome")) { | ||
base::ReplaceFirstSubstringAfterOffset( | ||
&new_formatted_url, | ||
0, | ||
base::UTF8ToUTF16("chrome://"), | ||
base::UTF8ToUTF16("brave://")); | ||
} | ||
|
||
return new_formatted_url; | ||
} |
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,28 @@ | ||
/* 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_BROWSER_UI_TOOLBAR_BRAVE_LOCATION_BAR_MODEL_DELEGATE_H_ | ||
#define BRAVE_BROWSER_UI_TOOLBAR_BRAVE_LOCATION_BAR_MODEL_DELEGATE_H_ | ||
|
||
#include "base/compiler_specific.h" | ||
#include "base/macros.h" | ||
#include "chrome/browser/ui/browser_location_bar_model_delegate.h" | ||
|
||
class Browser; | ||
|
||
class BraveLocationBarModelDelegate : public BrowserLocationBarModelDelegate { | ||
public: | ||
explicit BraveLocationBarModelDelegate(Browser* browser); | ||
~BraveLocationBarModelDelegate() override; | ||
|
||
private: | ||
base::string16 FormattedStringWithEquivalentMeaning( | ||
const GURL& url, | ||
const base::string16& formatted_url) const override; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(BraveLocationBarModelDelegate); | ||
}; | ||
|
||
#endif // BRAVE_BROWSER_UI_TOOLBAR_BRAVE_LOCATION_BAR_MODEL_DELEGATE_H_ |
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
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
Oops, something went wrong.