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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 1908363002: Nuke chrome.embeddedeseach.newTabPage.navigateContentWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « chrome/renderer/searchbox/searchbox.cc ('k') | chrome/test/data/local_ntp_browsertest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 66665ec85355955f1f0934ea10fed0ff51968f57..e2aa8ab777589f1b1d22aa9510ddebf8136be31c 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -425,10 +425,6 @@ class SearchBoxExtensionWrapper : public v8::Extension {
static void GetAppLauncherEnabled(
const v8::FunctionCallbackInfo<v8::Value>& args);
- // Gets the desired navigation behavior from a click event.
- static void GetDispositionFromClick(
- const v8::FunctionCallbackInfo<v8::Value>& args);
-
// Gets Most Visited Items.
static void GetMostVisitedItems(
const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -480,10 +476,6 @@ class SearchBoxExtensionWrapper : public v8::Extension {
static void LogMostVisitedNavigation(
const v8::FunctionCallbackInfo<v8::Value>& args);
- // Navigates the window to a URL represented by a restricted ID.
- static void NavigateContentWindow(
- const v8::FunctionCallbackInfo<v8::Value>& args);
-
// Pastes provided value or clipboard's content into the omnibox.
static void Paste(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -611,8 +603,6 @@ SearchBoxExtensionWrapper::GetNativeFunctionTemplate(
return v8::FunctionTemplate::New(isolate, Focus);
if (name->Equals(v8::String::NewFromUtf8(isolate, "GetAppLauncherEnabled")))
return v8::FunctionTemplate::New(isolate, GetAppLauncherEnabled);
- if (name->Equals(v8::String::NewFromUtf8(isolate, "GetDispositionFromClick")))
- return v8::FunctionTemplate::New(isolate, GetDispositionFromClick);
if (name->Equals(v8::String::NewFromUtf8(isolate, "GetMostVisitedItems")))
return v8::FunctionTemplate::New(isolate, GetMostVisitedItems);
if (name->Equals(v8::String::NewFromUtf8(isolate, "GetMostVisitedItemData")))
@@ -643,8 +633,6 @@ SearchBoxExtensionWrapper::GetNativeFunctionTemplate(
v8::String::NewFromUtf8(isolate, "LogMostVisitedNavigation"))) {
return v8::FunctionTemplate::New(isolate, LogMostVisitedNavigation);
}
- if (name->Equals(v8::String::NewFromUtf8(isolate, "NavigateContentWindow")))
- return v8::FunctionTemplate::New(isolate, NavigateContentWindow);
if (name->Equals(v8::String::NewFromUtf8(isolate, "Paste")))
return v8::FunctionTemplate::New(isolate, Paste);
if (name->Equals(
@@ -740,32 +728,6 @@ void SearchBoxExtensionWrapper::GetAppLauncherEnabled(
}
// static
-void SearchBoxExtensionWrapper::GetDispositionFromClick(
- const v8::FunctionCallbackInfo<v8::Value>& args) {
- content::RenderView* render_view = GetRenderView();
- if (!render_view) return;
-
- if (args.Length() != 5) {
- ThrowInvalidParameters(args);
- return;
- }
-
- bool middle_button = args[0]->BooleanValue();
- bool alt_key = args[1]->BooleanValue();
- bool ctrl_key = args[2]->BooleanValue();
- bool meta_key = args[3]->BooleanValue();
- bool shift_key = args[4]->BooleanValue();
-
- WindowOpenDisposition disposition = ui::DispositionFromClick(middle_button,
- alt_key,
- ctrl_key,
- meta_key,
- shift_key);
- v8::Isolate* isolate = args.GetIsolate();
- args.GetReturnValue().Set(v8::Int32::New(isolate, disposition));
-}
-
-// static
void SearchBoxExtensionWrapper::GetMostVisitedItems(
const v8::FunctionCallbackInfo<v8::Value>& args) {
content::RenderView* render_view = GetRenderView();
@@ -1128,39 +1090,6 @@ void SearchBoxExtensionWrapper::LogMostVisitedNavigation(
}
// static
-void SearchBoxExtensionWrapper::NavigateContentWindow(
- const v8::FunctionCallbackInfo<v8::Value>& args) {
- content::RenderView* render_view = GetRenderView();
- if (!render_view) return;
-
- if (!args.Length() || !args[0]->IsNumber()) {
- ThrowInvalidParameters(args);
- return;
- }
-
- InstantRestrictedID rid = args[0]->Int32Value();
- InstantMostVisitedItem item;
- if (!SearchBox::Get(render_view)->GetMostVisitedItemWithID(rid, &item))
- return;
-
- GURL destination_url = item.url;
-
- DVLOG(1) << render_view << " NavigateContentWindow: " << destination_url;
-
- // Navigate the main frame. Note that the security checks are enforced by the
- // browser process in InstantService::IsValidURLForNavigation(), but some
- // simple checks here are useful for avoiding unnecessary IPCs.
- if (destination_url.is_valid() &&
- !destination_url.SchemeIs(url::kJavaScriptScheme)) {
- WindowOpenDisposition disposition = CURRENT_TAB;
- if (args[1]->IsNumber()) {
- disposition = (WindowOpenDisposition) args[1]->Uint32Value();
- }
- SearchBox::Get(render_view)->NavigateToURL(destination_url, disposition);
- }
-}
-
-// static
void SearchBoxExtensionWrapper::Paste(
const v8::FunctionCallbackInfo<v8::Value>& args) {
content::RenderView* render_view = GetRenderView();
« no previous file with comments | « chrome/renderer/searchbox/searchbox.cc ('k') | chrome/test/data/local_ntp_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698