Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: extensions/browser/app_window/app_window_contents.cc

Issue 2495213007: [Extensions] Use a separate IPC message for extension events (Closed)
Patch Set: lazyboys Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 void AppWindowContentsImpl::NativeWindowChanged( 66 void AppWindowContentsImpl::NativeWindowChanged(
67 NativeAppWindow* native_app_window) { 67 NativeAppWindow* native_app_window) {
68 base::ListValue args; 68 base::ListValue args;
69 std::unique_ptr<base::DictionaryValue> dictionary( 69 std::unique_ptr<base::DictionaryValue> dictionary(
70 new base::DictionaryValue()); 70 new base::DictionaryValue());
71 host_->GetSerializedState(dictionary.get()); 71 host_->GetSerializedState(dictionary.get());
72 args.Append(std::move(dictionary)); 72 args.Append(std::move(dictionary));
73 73
74 content::RenderFrameHost* rfh = web_contents_->GetMainFrame(); 74 content::RenderFrameHost* rfh = web_contents_->GetMainFrame();
75 rfh->Send(new ExtensionMsg_MessageInvoke( 75 rfh->Send(new ExtensionMsg_MessageInvoke(rfh->GetRoutingID(),
76 rfh->GetRoutingID(), host_->extension_id(), "app.window", 76 host_->extension_id(), "app.window",
77 "updateAppWindowProperties", args, false)); 77 "updateAppWindowProperties", args));
78 } 78 }
79 79
80 void AppWindowContentsImpl::NativeWindowClosed() { 80 void AppWindowContentsImpl::NativeWindowClosed() {
81 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); 81 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
82 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); 82 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID()));
83 } 83 }
84 84
85 void AppWindowContentsImpl::DispatchWindowShownForTests() const { 85 void AppWindowContentsImpl::DispatchWindowShownForTests() const {
86 base::ListValue args; 86 base::ListValue args;
87 content::RenderFrameHost* rfh = web_contents_->GetMainFrame(); 87 content::RenderFrameHost* rfh = web_contents_->GetMainFrame();
88 rfh->Send(new ExtensionMsg_MessageInvoke( 88 rfh->Send(new ExtensionMsg_MessageInvoke(rfh->GetRoutingID(),
89 rfh->GetRoutingID(), host_->extension_id(), "app.window", 89 host_->extension_id(), "app.window",
90 "appWindowShownForTests", args, false)); 90 "appWindowShownForTests", args));
91 } 91 }
92 92
93 void AppWindowContentsImpl::OnWindowReady() { 93 void AppWindowContentsImpl::OnWindowReady() {
94 is_window_ready_ = true; 94 is_window_ready_ = true;
95 if (is_blocking_requests_) { 95 if (is_blocking_requests_) {
96 is_blocking_requests_ = false; 96 is_blocking_requests_ = false;
97 content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI( 97 content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI(
98 web_contents_->GetMainFrame()); 98 web_contents_->GetMainFrame());
99 } 99 }
100 } 100 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 content::RenderFrameHost* rfh) { 132 content::RenderFrameHost* rfh) {
133 DCHECK(rfh); 133 DCHECK(rfh);
134 // 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.
135 if (is_window_ready_) 135 if (is_window_ready_)
136 return; 136 return;
137 is_blocking_requests_ = true; 137 is_blocking_requests_ = true;
138 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); 138 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh);
139 } 139 }
140 140
141 } // namespace extensions 141 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_unittest.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698