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

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

Issue 10960003: Browser Plugin: Implement Back, Forward, and Go. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test 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::Back(int instance_id) {
218 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
219 if (!guest)
lazyboy 2012/09/20 20:05:42 Here and below: if (guest) guest->Back(); patte
Fady Samuel 2012/09/21 15:21:56 Done.
220 return;
221 guest->Back();
222 }
223
224 void BrowserPluginEmbedder::Forward(int instance_id) {
225 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
226 if (!guest)
227 return;
228 guest->Forward();
229 }
230
231 void BrowserPluginEmbedder::Go(int instance_id, int relative_index) {
232 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
233 if (!guest)
234 return;
235 guest->Go(relative_index);
236 }
237
217 void BrowserPluginEmbedder::Observe(int type, 238 void BrowserPluginEmbedder::Observe(int type,
218 const NotificationSource& source, 239 const NotificationSource& source,
219 const NotificationDetails& details) { 240 const NotificationDetails& details) {
220 switch (type) { 241 switch (type) {
221 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: { 242 case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: {
222 bool visible = *Details<bool>(details).ptr(); 243 bool visible = *Details<bool>(details).ptr();
223 WebContentsVisibilityChanged(visible); 244 WebContentsVisibilityChanged(visible);
224 break; 245 break;
225 } 246 }
226 default: 247 default:
227 NOTREACHED() << "Unexpected notification type: " << type; 248 NOTREACHED() << "Unexpected notification type: " << type;
228 } 249 }
229 } 250 }
230 251
231 } // namespace content 252 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698