From a60be1563f444c8e5bc3bbe8b957adf117cf2816 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 27 Dec 2013 14:32:24 +0800 Subject: [PATCH] Do not implement window.open. --- browser/native_window.cc | 18 ------------------ browser/native_window.h | 5 ----- 2 files changed, 23 deletions(-) diff --git a/browser/native_window.cc b/browser/native_window.cc index ad7773327e6b..2411464a723c 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -280,24 +280,6 @@ void NativeWindow::NotifyWindowBlur() { FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowBlur()); } -// Window opened by window.open. -void NativeWindow::WebContentsCreated( - content::WebContents* source_contents, - int64 source_frame_id, - const string16& frame_name, - const GURL& target_url, - content::WebContents* new_contents) { - LOG(WARNING) << "Please use node-style Window API to create window, " - "using window.open has very strict constrains."; - - scoped_ptr options(new base::DictionaryValue); - options->SetInteger(switches::kWidth, 800); - options->SetInteger(switches::kHeight, 600); - - NativeWindow* window = Create(new_contents, options.get()); - window->InitFromOptions(options.get()); -} - content::JavaScriptDialogManager* NativeWindow::GetJavaScriptDialogManager() { if (!dialog_manager_) dialog_manager_.reset(new AtomJavaScriptDialogManager); diff --git a/browser/native_window.h b/browser/native_window.h index 5e1346138c97..4978ef9bdb77 100644 --- a/browser/native_window.h +++ b/browser/native_window.h @@ -157,11 +157,6 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, const std::vector& regions) = 0; // Implementations of content::WebContentsDelegate. - virtual void WebContentsCreated(content::WebContents* source_contents, - int64 source_frame_id, - const string16& frame_name, - const GURL& target_url, - content::WebContents* new_contents) OVERRIDE; virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE; virtual void BeforeUnloadFired(content::WebContents* tab,