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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 web_contents->WasShown(); | 215 web_contents->WasShown(); |
216 else | 216 else |
217 web_contents->WasHidden(); | 217 web_contents->WasHidden(); |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 void BrowserPluginEmbedder::PluginDestroyed(int instance_id) { | 221 void BrowserPluginEmbedder::PluginDestroyed(int instance_id) { |
222 DestroyGuestByInstanceID(instance_id); | 222 DestroyGuestByInstanceID(instance_id); |
223 } | 223 } |
224 | 224 |
| 225 void BrowserPluginEmbedder::Go(int instance_id, int relative_index) { |
| 226 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
| 227 if (guest) |
| 228 guest->Go(relative_index); |
| 229 } |
| 230 |
225 void BrowserPluginEmbedder::Stop(int instance_id) { | 231 void BrowserPluginEmbedder::Stop(int instance_id) { |
226 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 232 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
227 if (guest) | 233 if (guest) |
228 guest->Stop(); | 234 guest->Stop(); |
229 } | 235 } |
230 | 236 |
231 void BrowserPluginEmbedder::Reload(int instance_id) { | 237 void BrowserPluginEmbedder::Reload(int instance_id) { |
232 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 238 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
233 if (guest) | 239 if (guest) |
234 guest->Reload(); | 240 guest->Reload(); |
235 } | 241 } |
236 | 242 |
237 void BrowserPluginEmbedder::Observe(int type, | 243 void BrowserPluginEmbedder::Observe(int type, |
238 const NotificationSource& source, | 244 const NotificationSource& source, |
239 const NotificationDetails& details) { | 245 const NotificationDetails& details) { |
240 switch (type) { | 246 switch (type) { |
241 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: { | 247 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: { |
242 bool visible = *Details<bool>(details).ptr(); | 248 bool visible = *Details<bool>(details).ptr(); |
243 WebContentsVisibilityChanged(visible); | 249 WebContentsVisibilityChanged(visible); |
244 break; | 250 break; |
245 } | 251 } |
246 default: | 252 default: |
247 NOTREACHED() << "Unexpected notification type: " << type; | 253 NOTREACHED() << "Unexpected notification type: " << type; |
248 } | 254 } |
249 } | 255 } |
250 | 256 |
251 } // namespace content | 257 } // namespace content |
OLD | NEW |