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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 10917225: Browser Plugin: Reload and Stop operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments + merged with ToT/latest patch Created 8 years, 3 months 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 | Annotate | Revision Log
OLDNEW
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 web_contents->WasShown(); 207 web_contents->WasShown();
208 else 208 else
209 web_contents->WasHidden(); 209 web_contents->WasHidden();
210 } 210 }
211 } 211 }
212 212
213 void BrowserPluginEmbedder::PluginDestroyed(int instance_id) { 213 void BrowserPluginEmbedder::PluginDestroyed(int instance_id) {
214 DestroyGuestByInstanceID(instance_id); 214 DestroyGuestByInstanceID(instance_id);
215 } 215 }
216 216
217 void BrowserPluginEmbedder::Stop(int instance_id) {
218 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
219 if (guest)
220 guest->Stop();
221 }
222
223 void BrowserPluginEmbedder::Reload(int instance_id) {
224 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
225 if (guest)
226 guest->Reload();
227 }
228
217 void BrowserPluginEmbedder::Observe(int type, 229 void BrowserPluginEmbedder::Observe(int type,
218 const NotificationSource& source, 230 const NotificationSource& source,
219 const NotificationDetails& details) { 231 const NotificationDetails& details) {
220 switch (type) { 232 switch (type) {
221 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: { 233 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: {
222 bool visible = *Details<bool>(details).ptr(); 234 bool visible = *Details<bool>(details).ptr();
223 WebContentsVisibilityChanged(visible); 235 WebContentsVisibilityChanged(visible);
224 break; 236 break;
225 } 237 }
226 default: 238 default:
227 NOTREACHED() << "Unexpected notification type: " << type; 239 NOTREACHED() << "Unexpected notification type: " << type;
228 } 240 }
229 } 241 }
230 242
231 } // namespace content 243 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698