Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_embedder.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" | 8 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" |
| 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 | 308 |
| 309 void BrowserPluginEmbedder::SetAutoSize( | 309 void BrowserPluginEmbedder::SetAutoSize( |
| 310 int instance_id, | 310 int instance_id, |
| 311 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 311 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 312 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) { | 312 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params) { |
| 313 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 313 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| 314 if (guest) | 314 if (guest) |
| 315 guest->SetSize(auto_size_params, resize_guest_params); | 315 guest->SetSize(auto_size_params, resize_guest_params); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void BrowserPluginEmbedder::AllowMediaAccess(int instance_id, | |
| 319 int request_id, | |
| 320 bool should_allow) { | |
| 321 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | |
|
Charlie Reis
2012/12/07 19:16:25
Should we have a security check here, ensuring tha
lazyboy
2012/12/07 22:50:44
(see next comment)
| |
| 322 if (guest) | |
| 323 guest->AllowMediaAccess(web_contents(), request_id, should_allow); | |
| 324 } | |
| 325 | |
| 318 void BrowserPluginEmbedder::Go(int instance_id, int relative_index) { | 326 void BrowserPluginEmbedder::Go(int instance_id, int relative_index) { |
| 319 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 327 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| 320 if (guest) | 328 if (guest) |
| 321 guest->Go(relative_index); | 329 guest->Go(relative_index); |
| 322 } | 330 } |
| 323 | 331 |
| 324 void BrowserPluginEmbedder::Stop(int instance_id) { | 332 void BrowserPluginEmbedder::Stop(int instance_id) { |
| 325 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 333 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| 326 if (guest) | 334 if (guest) |
| 327 guest->Stop(); | 335 guest->Stop(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 380 bool visible = *Details<bool>(details).ptr(); | 388 bool visible = *Details<bool>(details).ptr(); |
| 381 WebContentsVisibilityChanged(visible); | 389 WebContentsVisibilityChanged(visible); |
| 382 break; | 390 break; |
| 383 } | 391 } |
| 384 default: | 392 default: |
| 385 NOTREACHED() << "Unexpected notification type: " << type; | 393 NOTREACHED() << "Unexpected notification type: " << type; |
| 386 } | 394 } |
| 387 } | 395 } |
| 388 | 396 |
| 389 } // namespace content | 397 } // namespace content |
| OLD | NEW |