| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 web_contents->WasShown(); | 261 web_contents->WasShown(); |
| 262 else | 262 else |
| 263 web_contents->WasHidden(); | 263 web_contents->WasHidden(); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 void BrowserPluginEmbedder::PluginDestroyed(int instance_id) { | 267 void BrowserPluginEmbedder::PluginDestroyed(int instance_id) { |
| 268 DestroyGuestByInstanceID(instance_id); | 268 DestroyGuestByInstanceID(instance_id); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void BrowserPluginEmbedder::Stop(int instance_id) { |
| 272 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| 273 if (guest) |
| 274 guest->Stop(); |
| 275 } |
| 276 |
| 277 void BrowserPluginEmbedder::Reload(int instance_id) { |
| 278 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| 279 if (guest) |
| 280 guest->Reload(); |
| 281 } |
| 282 |
| 271 void BrowserPluginEmbedder::Observe(int type, | 283 void BrowserPluginEmbedder::Observe(int type, |
| 272 const NotificationSource& source, | 284 const NotificationSource& source, |
| 273 const NotificationDetails& details) { | 285 const NotificationDetails& details) { |
| 274 switch (type) { | 286 switch (type) { |
| 275 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: { | 287 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: { |
| 276 bool visible = *Details<bool>(details).ptr(); | 288 bool visible = *Details<bool>(details).ptr(); |
| 277 WebContentsVisibilityChanged(visible); | 289 WebContentsVisibilityChanged(visible); |
| 278 break; | 290 break; |
| 279 } | 291 } |
| 280 default: | 292 default: |
| 281 NOTREACHED() << "Unexpected notification type: " << type; | 293 NOTREACHED() << "Unexpected notification type: " << type; |
| 282 } | 294 } |
| 283 } | 295 } |
| 284 | 296 |
| 285 } // namespace content | 297 } // namespace content |
| OLD | NEW |