Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3849)

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 2232863002: Remove search::GetSearchTerms since it always returns empty string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_query_extract
Patch Set: Mac Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index 75a778970012546e8a38d2a1c469b5dfed94a768..b9aba854d40f9d43a3d79969b9d6bc4fc4383a19 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -935,11 +935,6 @@ void OmniboxViewMac::OnMouseDown(NSInteger button_number) {
model()->SetCaretVisibility(true);
}
-bool OmniboxViewMac::ShouldSelectAllOnMouseDown() {
- return !controller()->GetToolbarModel()->WouldPerformSearchTermReplacement(
- false);
-}
-
bool OmniboxViewMac::CanCopy() {
const NSRange selection = GetSelectedRange();
return selection.length > 0;
@@ -952,15 +947,11 @@ base::scoped_nsobject<NSPasteboardItem> OmniboxViewMac::CreatePasteboardItem() {
base::string16 text = base::SysNSStringToUTF16(
[[field_ stringValue] substringWithRange:selection]);
- // Copy the URL unless this is the search URL and it's being replaced by the
- // Extended Instant API.
+ // Copy the URL.
GURL url;
bool write_url = false;
- if (!controller()->GetToolbarModel()->WouldPerformSearchTermReplacement(
- false)) {
- model()->AdjustTextForCopy(selection.location, IsSelectAll(), &text, &url,
- &write_url);
- }
+ model()->AdjustTextForCopy(selection.location, IsSelectAll(), &text, &url,
+ &write_url);
if (IsSelectAll())
UMA_HISTOGRAM_COUNTS(OmniboxEditModel::kCutOrCopyAllTextHistogram, 1);
@@ -980,11 +971,6 @@ void OmniboxViewMac::CopyToPasteboard(NSPasteboard* pboard) {
[pboard writeObjects:@[ item.get() ]];
}
-void OmniboxViewMac::ShowURL() {
- DCHECK(ShouldEnableShowURL());
- OmniboxView::ShowURL();
Peter Kasting 2016/08/13 05:03:44 Remember to eventually rip out the other call chai
Marc Treib 2016/08/16 12:00:17 Yup, follow-up on the way!
-}
-
void OmniboxViewMac::OnPaste() {
// This code currently expects |field_| to be focused.
DCHECK([field_ currentEditor]);
@@ -1017,14 +1003,6 @@ void OmniboxViewMac::OnPaste() {
}
}
-// TODO(dominich): Move to OmniboxView base class? Currently this is defined on
-// the AutocompleteTextFieldObserver but the logic is shared between all
-// platforms. Some refactor might be necessary to simplify this. Or at least
-// this method could call the OmniboxView version.
-bool OmniboxViewMac::ShouldEnableShowURL() {
- return controller()->GetToolbarModel()->WouldReplaceURL();
-}
-
bool OmniboxViewMac::CanPasteAndGo() {
return model()->CanPasteAndGo(GetClipboardText());
}

Powered by Google App Engine
This is Rietveld 408576698