diff options
author | shuchen <shuchen@chromium.org> | 2016-02-23 02:09:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-23 10:10:15 +0000 |
commit | 70a6b07aa3b2991d11b6b7c158752d6460555359 (patch) | |
tree | 1b4f610479b01aafff5d4971917e987340773793 /extensions/renderer | |
parent | 3cbfbfb9a38555d156e4034435de61722503c7c8 (diff) | |
download | chromium_src-70a6b07aa3b2991d11b6b7c158752d6460555359.zip chromium_src-70a6b07aa3b2991d11b6b7c158752d6460555359.tar.gz chromium_src-70a6b07aa3b2991d11b6b7c158752d6460555359.tar.bz2 |
Returns JS 'window' object for chrome.input.ime.createWindow API.
This cl is based on cl https://codereview.chromium.org/1595313002.
BUG=517773
Review URL: https://codereview.chromium.org/1649373002
Cr-Commit-Position: refs/heads/master@{#376959}
Diffstat (limited to 'extensions/renderer')
-rw-r--r-- | extensions/renderer/app_window_custom_bindings.cc | 11 | ||||
-rw-r--r-- | extensions/renderer/resources/app_window_custom_bindings.js | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/extensions/renderer/app_window_custom_bindings.cc b/extensions/renderer/app_window_custom_bindings.cc index 04e45a1..02df633 100644 --- a/extensions/renderer/app_window_custom_bindings.cc +++ b/extensions/renderer/app_window_custom_bindings.cc @@ -34,13 +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() != 1) + if (args.Length() != 2) return; - if (!args[0]->IsInt32()) + if (!args[0]->IsInt32() || !args[1]->IsBoolean()) return; int frame_id = args[0]->Int32Value(); + bool notify_browser = args[1]->BooleanValue(); if (frame_id == MSG_ROUTING_NONE) return; @@ -62,8 +63,10 @@ void AppWindowCustomBindings::GetFrame( blink::WebLocalFrame* app_web_frame = app_frame->GetWebFrame(); app_web_frame->setOpener(opener); - content::RenderThread::Get()->Send(new ExtensionHostMsg_AppWindowReady( - app_frame->GetRenderView()->GetRoutingID())); + if (notify_browser) { + content::RenderThread::Get()->Send(new ExtensionHostMsg_AppWindowReady( + app_frame->GetRenderView()->GetRoutingID())); + } v8::Local<v8::Value> window = app_web_frame->mainWorldScriptContext()->Global(); diff --git a/extensions/renderer/resources/app_window_custom_bindings.js b/extensions/renderer/resources/app_window_custom_bindings.js index 3800bea..b0ae54f 100644 --- a/extensions/renderer/resources/app_window_custom_bindings.js +++ b/extensions/renderer/resources/app_window_custom_bindings.js @@ -118,8 +118,10 @@ appWindow.registerCustomHook(function(bindingsAPI) { var view = null; // When window creation fails, |windowParams| will be undefined. - if (windowParams && windowParams.frameId) - view = appWindowNatives.GetFrame(windowParams.frameId); + if (windowParams && windowParams.frameId) { + view = appWindowNatives.GetFrame( + windowParams.frameId, true /* notifyBrowser */); + } if (!view) { // No route to created window. If given a callback, trigger it with an |