summaryrefslogtreecommitdiffstats
path: root/extensions/renderer
diff options
context:
space:
mode:
authorrob <rob@robwu.nl>2016-02-15 03:06:26 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-15 11:07:13 +0000
commitaefd358f97ba1a4462e4853b9ce4a3e340c6efba (patch)
treeb319fe48695e16d4c21f70dbfdaa9e915eb7fd99 /extensions/renderer
parente8b36a62043b0998bc06cc6e0a317fbec14c628b (diff)
downloadchromium_src-aefd358f97ba1a4462e4853b9ce4a3e340c6efba.zip
chromium_src-aefd358f97ba1a4462e4853b9ce4a3e340c6efba.tar.gz
chromium_src-aefd358f97ba1a4462e4853b9ce4a3e340c6efba.tar.bz2
Remove "experimental-html" from chrome.app.window
The "experimental-html" frame option is behind a flag, undocumented and seems not used by real app developers. Review URL: https://codereview.chromium.org/1690893003 Cr-Commit-Position: refs/heads/master@{#375443}
Diffstat (limited to 'extensions/renderer')
-rw-r--r--extensions/renderer/app_window_custom_bindings.cc50
-rw-r--r--extensions/renderer/app_window_custom_bindings.h6
-rw-r--r--extensions/renderer/dispatcher.cc6
-rw-r--r--extensions/renderer/resources/app_window_custom_bindings.js6
4 files changed, 7 insertions, 61 deletions
diff --git a/extensions/renderer/app_window_custom_bindings.cc b/extensions/renderer/app_window_custom_bindings.cc
index b61c384..04e45a1 100644
--- a/extensions/renderer/app_window_custom_bindings.cc
+++ b/extensions/renderer/app_window_custom_bindings.cc
@@ -4,19 +4,14 @@
#include "extensions/renderer/app_window_custom_bindings.h"
-#include <string>
-
#include "base/command_line.h"
-#include "base/macros.h"
#include "content/public/child/v8_value_converter.h"
#include "content/public/renderer/render_frame.h"
-#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/switches.h"
#include "extensions/renderer/script_context.h"
-#include "extensions/renderer/script_context_set.h"
#include "grit/extensions_renderer_resources.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebView.h"
@@ -25,39 +20,8 @@
namespace extensions {
-class DidCreateDocumentElementObserver : public content::RenderFrameObserver {
- public:
- DidCreateDocumentElementObserver(content::RenderFrame* frame,
- const ScriptContextSet* script_context_set)
- : content::RenderFrameObserver(frame),
- script_context_set_(script_context_set) {
- DCHECK(script_context_set_);
- }
-
- void DidCreateDocumentElement() override {
- blink::WebLocalFrame* web_frame = render_frame()->GetWebFrame();
- // Don't attempt to inject the titlebar into iframes.
- if (web_frame->parent())
- return;
- ScriptContext* script_context = script_context_set_->GetByV8Context(
- web_frame->mainWorldScriptContext());
- if (!script_context)
- return;
- script_context->module_system()->CallModuleMethod(
- "injectAppTitlebar", "didCreateDocumentElement");
- }
-
- private:
- const ScriptContextSet* script_context_set_;
-
- DISALLOW_COPY_AND_ASSIGN(DidCreateDocumentElementObserver);
-};
-
-AppWindowCustomBindings::AppWindowCustomBindings(
- const ScriptContextSet* script_context_set,
- ScriptContext* context)
- : ObjectBackedNativeHandler(context),
- script_context_set_(script_context_set) {
+AppWindowCustomBindings::AppWindowCustomBindings(ScriptContext* context)
+ : ObjectBackedNativeHandler(context) {
RouteFunction("GetFrame", base::Bind(&AppWindowCustomBindings::GetFrame,
base::Unretained(this)));
@@ -70,19 +34,14 @@ void AppWindowCustomBindings::GetFrame(
const v8::FunctionCallbackInfo<v8::Value>& args) {
// TODO(jeremya): convert this to IDL nocompile to get validation, and turn
// these argument checks into CHECK().
- if (args.Length() != 2)
+ if (args.Length() != 1)
return;
if (!args[0]->IsInt32())
return;
- if (!args[1]->IsBoolean())
- return;
-
int frame_id = args[0]->Int32Value();
- bool inject_titlebar = args[1]->BooleanValue();
-
if (frame_id == MSG_ROUTING_NONE)
return;
@@ -99,9 +58,6 @@ void AppWindowCustomBindings::GetFrame(
if (!context_render_frame)
return;
- if (inject_titlebar)
- new DidCreateDocumentElementObserver(app_frame, script_context_set_);
-
blink::WebFrame* opener = context_render_frame->GetWebFrame();
blink::WebLocalFrame* app_web_frame = app_frame->GetWebFrame();
app_web_frame->setOpener(opener);
diff --git a/extensions/renderer/app_window_custom_bindings.h b/extensions/renderer/app_window_custom_bindings.h
index 26e02c7..3fbab04 100644
--- a/extensions/renderer/app_window_custom_bindings.h
+++ b/extensions/renderer/app_window_custom_bindings.h
@@ -14,8 +14,7 @@ class ScriptContextSet;
// Implements custom bindings for the app.window API.
class AppWindowCustomBindings : public ObjectBackedNativeHandler {
public:
- AppWindowCustomBindings(const ScriptContextSet* script_context_set,
- ScriptContext* context);
+ AppWindowCustomBindings(ScriptContext* context);
private:
void GetFrame(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -25,9 +24,6 @@ class AppWindowCustomBindings : public ObjectBackedNativeHandler {
void GetWindowControlsHtmlTemplate(
const v8::FunctionCallbackInfo<v8::Value>& args);
- // ScriptContextSet handle. Not owned.
- const ScriptContextSet* script_context_set_;
-
DISALLOW_COPY_AND_ASSIGN(AppWindowCustomBindings);
};
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index a8a2b3e..2c6ad7d 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -807,13 +807,9 @@ void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system,
scoped_ptr<NativeHandler>(new FileSystemNatives(context)));
// Custom bindings.
- // |dispatcher| is null in unit tests.
- const ScriptContextSet* script_context_set = dispatcher ?
- &dispatcher->script_context_set() : nullptr;
module_system->RegisterNativeHandler(
"app_window_natives",
- scoped_ptr<NativeHandler>(new AppWindowCustomBindings(
- script_context_set, context)));
+ scoped_ptr<NativeHandler>(new AppWindowCustomBindings(context)));
module_system->RegisterNativeHandler(
"blob_natives",
scoped_ptr<NativeHandler>(new BlobNativeHandler(context)));
diff --git a/extensions/renderer/resources/app_window_custom_bindings.js b/extensions/renderer/resources/app_window_custom_bindings.js
index 63f1eae..3800bea 100644
--- a/extensions/renderer/resources/app_window_custom_bindings.js
+++ b/extensions/renderer/resources/app_window_custom_bindings.js
@@ -118,10 +118,8 @@ appWindow.registerCustomHook(function(bindingsAPI) {
var view = null;
// When window creation fails, |windowParams| will be undefined.
- if (windowParams && windowParams.frameId) {
- view = appWindowNatives.GetFrame(
- windowParams.frameId, windowParams.injectTitlebar);
- }
+ if (windowParams && windowParams.frameId)
+ view = appWindowNatives.GetFrame(windowParams.frameId);
if (!view) {
// No route to created window. If given a callback, trigger it with an