OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/custom_launcher_page_contents.h" | 5 #include "apps/custom_launcher_page_contents.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 | 120 |
121 void CustomLauncherPageContents::RequestMediaAccessPermission( | 121 void CustomLauncherPageContents::RequestMediaAccessPermission( |
122 content::WebContents* web_contents, | 122 content::WebContents* web_contents, |
123 const content::MediaStreamRequest& request, | 123 const content::MediaStreamRequest& request, |
124 const content::MediaResponseCallback& callback) { | 124 const content::MediaResponseCallback& callback) { |
125 DCHECK_EQ(web_contents_.get(), web_contents); | 125 DCHECK_EQ(web_contents_.get(), web_contents); |
126 helper_->RequestMediaAccessPermission(request, callback); | 126 helper_->RequestMediaAccessPermission(request, callback); |
127 } | 127 } |
128 | 128 |
| 129 bool CustomLauncherPageContents::CheckMediaAccessPermission( |
| 130 content::WebContents* web_contents, |
| 131 const GURL& security_origin, |
| 132 content::MediaStreamType type) { |
| 133 DCHECK_EQ(web_contents_.get(), web_contents); |
| 134 return helper_->CheckMediaAccessPermission(security_origin, type); |
| 135 } |
| 136 |
129 bool CustomLauncherPageContents::OnMessageReceived( | 137 bool CustomLauncherPageContents::OnMessageReceived( |
130 const IPC::Message& message) { | 138 const IPC::Message& message) { |
131 bool handled = true; | 139 bool handled = true; |
132 IPC_BEGIN_MESSAGE_MAP(CustomLauncherPageContents, message) | 140 IPC_BEGIN_MESSAGE_MAP(CustomLauncherPageContents, message) |
133 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 141 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
134 IPC_MESSAGE_UNHANDLED(handled = false) | 142 IPC_MESSAGE_UNHANDLED(handled = false) |
135 IPC_END_MESSAGE_MAP() | 143 IPC_END_MESSAGE_MAP() |
136 return handled; | 144 return handled; |
137 } | 145 } |
138 | 146 |
139 extensions::WindowController* | 147 extensions::WindowController* |
140 CustomLauncherPageContents::GetExtensionWindowController() const { | 148 CustomLauncherPageContents::GetExtensionWindowController() const { |
141 return NULL; | 149 return NULL; |
142 } | 150 } |
143 | 151 |
144 content::WebContents* CustomLauncherPageContents::GetAssociatedWebContents() | 152 content::WebContents* CustomLauncherPageContents::GetAssociatedWebContents() |
145 const { | 153 const { |
146 return web_contents(); | 154 return web_contents(); |
147 } | 155 } |
148 | 156 |
149 void CustomLauncherPageContents::OnRequest( | 157 void CustomLauncherPageContents::OnRequest( |
150 const ExtensionHostMsg_Request_Params& params) { | 158 const ExtensionHostMsg_Request_Params& params) { |
151 extension_function_dispatcher_->Dispatch(params, | 159 extension_function_dispatcher_->Dispatch(params, |
152 web_contents_->GetRenderViewHost()); | 160 web_contents_->GetRenderViewHost()); |
153 } | 161 } |
154 | 162 |
155 } // namespace apps | 163 } // namespace apps |
OLD | NEW |