OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/app_window/app_window_contents.h" | 5 #include "extensions/browser/app_window/app_window_contents.h" |
6 | 6 |
| 7 #include <memory> |
7 #include <string> | 8 #include <string> |
8 #include <utility> | 9 #include <utility> |
9 | 10 |
10 #include "content/public/browser/browser_context.h" | 11 #include "content/public/browser/browser_context.h" |
11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
12 #include "content/public/browser/render_frame_host.h" | 13 #include "content/public/browser/render_frame_host.h" |
13 #include "content/public/browser/render_process_host.h" | 14 #include "content/public/browser/render_process_host.h" |
14 #include "content/public/browser/render_view_host.h" | 15 #include "content/public/browser/render_view_host.h" |
15 #include "content/public/browser/resource_dispatcher_host.h" | 16 #include "content/public/browser/resource_dispatcher_host.h" |
16 #include "content/public/browser/site_instance.h" | 17 #include "content/public/browser/site_instance.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 59 } |
59 | 60 |
60 web_contents_->GetController().LoadURL( | 61 web_contents_->GetController().LoadURL( |
61 url_, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 62 url_, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
62 std::string()); | 63 std::string()); |
63 } | 64 } |
64 | 65 |
65 void AppWindowContentsImpl::NativeWindowChanged( | 66 void AppWindowContentsImpl::NativeWindowChanged( |
66 NativeAppWindow* native_app_window) { | 67 NativeAppWindow* native_app_window) { |
67 base::ListValue args; | 68 base::ListValue args; |
68 base::DictionaryValue* dictionary = new base::DictionaryValue(); | 69 std::unique_ptr<base::DictionaryValue> dictionary( |
69 args.Append(dictionary); | 70 new base::DictionaryValue()); |
70 host_->GetSerializedState(dictionary); | 71 host_->GetSerializedState(dictionary.get()); |
| 72 args.Append(std::move(dictionary)); |
71 | 73 |
72 content::RenderFrameHost* rfh = web_contents_->GetMainFrame(); | 74 content::RenderFrameHost* rfh = web_contents_->GetMainFrame(); |
73 rfh->Send(new ExtensionMsg_MessageInvoke( | 75 rfh->Send(new ExtensionMsg_MessageInvoke( |
74 rfh->GetRoutingID(), host_->extension_id(), "app.window", | 76 rfh->GetRoutingID(), host_->extension_id(), "app.window", |
75 "updateAppWindowProperties", args, false)); | 77 "updateAppWindowProperties", args, false)); |
76 } | 78 } |
77 | 79 |
78 void AppWindowContentsImpl::NativeWindowClosed() { | 80 void AppWindowContentsImpl::NativeWindowClosed() { |
79 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 81 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
80 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); | 82 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 content::RenderFrameHost* rfh) { | 132 content::RenderFrameHost* rfh) { |
131 DCHECK(rfh); | 133 DCHECK(rfh); |
132 // Don't bother blocking requests if the renderer side is already good to go. | 134 // Don't bother blocking requests if the renderer side is already good to go. |
133 if (is_window_ready_) | 135 if (is_window_ready_) |
134 return; | 136 return; |
135 is_blocking_requests_ = true; | 137 is_blocking_requests_ = true; |
136 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); | 138 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); |
137 } | 139 } |
138 | 140 |
139 } // namespace extensions | 141 } // namespace extensions |
OLD | NEW |