-
Notifications
You must be signed in to change notification settings - Fork 885
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
Fixed brave scheme url is changed to chrome scheme url when copying from omnibox #4512
Conversation
Kindly ping to owner :) @bridiver |
|
||
if (ShouldAdjust(original_selected_text, selected_text)) { | ||
BraveLocationBarModelDelegate::FormattedStringFromURL(url, &selected_text); | ||
ReplaceChromeSchemeToBrave(&url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic exists in too many places and needs to be consolidated into some kind of utility function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most other places are converting from brave to chrome scheme.
but we need to convert from chrome to brave.
|
||
namespace { | ||
// Copied from omnibox_view_views.cc | ||
constexpr base::Feature kOmniboxCanCopyHyperlinksToClipboard{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we copying this? It's completely pointless because we'd have to track upstream changes anyway which is a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
|
||
void BraveOmniboxViewViews::OnAfterCutOrCopy( | ||
ui::ClipboardBuffer clipboard_buffer) { | ||
ui::Clipboard* cb = ui::Clipboard::GetForCurrentThread(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't be copying this entire method. We only need different behavior the specific case of a chrome:// url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
ui::ScopedClipboardWriter scoped_clipboard_writer(clipboard_buffer); | ||
scoped_clipboard_writer.WriteText(selected_text); | ||
|
||
if (write_url && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feature flag is a problem as per comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
ad624a0
to
c765318
Compare
fix brave/brave-browser#1973
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
npm run test brave_browser_tests -- --filter=BraveOmniboxViewViewsTest*
Reviewer Checklist:
After-merge Checklist:
changes has landed on.