Chromium Code Reviews| Index: extensions/browser/api/app_window/app_window_api.cc |
| diff --git a/extensions/browser/api/app_window/app_window_api.cc b/extensions/browser/api/app_window/app_window_api.cc |
| index c14d3b1b51fd31887105a7ca4cbcca280dec812a..e2cafcc70d56ef1aa17dbe94001a9ed113dfbcf2 100644 |
| --- a/extensions/browser/api/app_window/app_window_api.cc |
| +++ b/extensions/browser/api/app_window/app_window_api.cc |
| @@ -13,7 +13,6 @@ |
| #include "content/public/browser/notification_types.h" |
| #include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/render_process_host.h" |
| -#include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/common/url_constants.h" |
| #include "extensions/browser/app_window/app_window.h" |
| @@ -175,12 +174,12 @@ bool AppWindowCreateFunction::RunAsync() { |
| ->GetAppWindowForAppAndKey( |
| extension_id(), create_params.window_key); |
| if (window) { |
| - content::RenderViewHost* created_view = |
| - window->web_contents()->GetRenderViewHost(); |
| - int view_id = MSG_ROUTING_NONE; |
| + content::RenderFrameHost* created_frame = |
|
not at google - send to devlin
2015/07/08 21:34:29
"created_frame" is actually a lie. The whole point
Devlin
2015/07/08 21:47:01
Done.
|
| + window->web_contents()->GetMainFrame(); |
| + int frame_id = MSG_ROUTING_NONE; |
| if (render_frame_host()->GetProcess()->GetID() == |
| - created_view->GetProcess()->GetID()) { |
| - view_id = created_view->GetRoutingID(); |
| + created_frame->GetProcess()->GetID()) { |
|
not at google - send to devlin
2015/07/08 20:22:19
Why does the API do this? Why not unconditionally
Devlin
2015/07/08 21:08:46
My guess is because if they are in different proce
not at google - send to devlin
2015/07/08 21:34:29
Yeah I feel like this should be a CHECK that they'
Devlin
2015/07/08 21:47:01
As discovered offline, this was added because comp
|
| + frame_id = created_frame->GetRoutingID(); |
| } |
| if (!options->hidden.get() || !*options->hidden.get()) { |
| @@ -191,7 +190,7 @@ bool AppWindowCreateFunction::RunAsync() { |
| } |
| base::DictionaryValue* result = new base::DictionaryValue; |
| - result->Set("viewId", new base::FundamentalValue(view_id)); |
| + result->Set("frameId", new base::FundamentalValue(frame_id)); |
| window->GetSerializedState(result); |
| result->SetBoolean("existingWindow", true); |
| // TODO(benwells): Remove HTML titlebar injection. |
| @@ -344,14 +343,14 @@ bool AppWindowCreateFunction::RunAsync() { |
| app_window->ForcedFullscreen(); |
| } |
| - content::RenderViewHost* created_view = |
| - app_window->web_contents()->GetRenderViewHost(); |
| - int view_id = MSG_ROUTING_NONE; |
| - if (create_params.creator_process_id == created_view->GetProcess()->GetID()) |
| - view_id = created_view->GetRoutingID(); |
| + content::RenderFrameHost* created_frame = |
| + app_window->web_contents()->GetMainFrame(); |
| + int frame_id = MSG_ROUTING_NONE; |
| + if (create_params.creator_process_id == created_frame->GetProcess()->GetID()) |
| + frame_id = created_frame->GetRoutingID(); |
| base::DictionaryValue* result = new base::DictionaryValue; |
| - result->Set("viewId", new base::FundamentalValue(view_id)); |
| + result->Set("frameId", new base::FundamentalValue(frame_id)); |
| result->Set("injectTitlebar", |
| new base::FundamentalValue(inject_html_titlebar_)); |
| result->Set("id", new base::StringValue(app_window->window_key())); |
| @@ -359,7 +358,7 @@ bool AppWindowCreateFunction::RunAsync() { |
| SetResult(result); |
| if (AppWindowRegistry::Get(browser_context()) |
| - ->HadDevToolsAttached(created_view)) { |
| + ->HadDevToolsAttached(app_window->web_contents())) { |
| AppWindowClient::Get()->OpenDevToolsWindow( |
| app_window->web_contents(), |
| base::Bind(&AppWindowCreateFunction::SendResponse, this, true)); |