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

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

Issue 98073015: <webview>: Support zoom in WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GTK Created 6 years, 11 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
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 "base/values.h" 7 #include "base/values.h"
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" 8 #include "content/browser/browser_plugin/browser_plugin_guest.h"
9 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h"
10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 WebContentsImpl* embedder = 114 WebContentsImpl* embedder =
115 static_cast<WebContentsImpl*>(web_contents()); 115 static_cast<WebContentsImpl*>(web_contents());
116 return GetBrowserPluginGuestManager()->ForEachGuest(embedder, base::Bind( 116 return GetBrowserPluginGuestManager()->ForEachGuest(embedder, base::Bind(
117 &BrowserPluginEmbedder::UnlockMouseIfNecessaryCallback, 117 &BrowserPluginEmbedder::UnlockMouseIfNecessaryCallback,
118 base::Unretained(this), 118 base::Unretained(this),
119 event)); 119 event));
120 } 120 }
121 121
122 bool BrowserPluginEmbedder::SetZoomLevelCallback(
123 double level, BrowserPluginGuest* guest) {
124 guest->GetWebContents()->SetZoomLevel(level);
125 // Not handled => Iterate over all guests.
126 return false;
127 }
128
129 void BrowserPluginEmbedder::SetZoomLevel(double level) {
130 WebContentsImpl* embedder =
131 static_cast<WebContentsImpl*>(web_contents());
132 GetBrowserPluginGuestManager()->ForEachGuest(embedder, base::Bind(
133 &BrowserPluginEmbedder::SetZoomLevelCallback,
134 base::Unretained(this),
135 level));
136 }
137
122 void BrowserPluginEmbedder::RenderProcessGone(base::TerminationStatus status) { 138 void BrowserPluginEmbedder::RenderProcessGone(base::TerminationStatus status) {
123 CleanUp(); 139 CleanUp();
124 } 140 }
125 141
126 bool BrowserPluginEmbedder::OnMessageReceived(const IPC::Message& message) { 142 bool BrowserPluginEmbedder::OnMessageReceived(const IPC::Message& message) {
127 bool handled = true; 143 bool handled = true;
128 IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedder, message) 144 IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedder, message)
129 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_AllocateInstanceID, 145 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_AllocateInstanceID,
130 OnAllocateInstanceID) 146 OnAllocateInstanceID)
131 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Attach, OnAttach) 147 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Attach, OnAttach)
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 if (guest) 269 if (guest)
254 render_view_host = guest->GetWebContents()->GetRenderViewHost(); 270 render_view_host = guest->GetWebContents()->GetRenderViewHost();
255 else // No plugin, use embedder's RenderViewHost. 271 else // No plugin, use embedder's RenderViewHost.
256 render_view_host = web_contents()->GetRenderViewHost(); 272 render_view_host = web_contents()->GetRenderViewHost();
257 273
258 callback_iter->second.Run(render_view_host, position.x(), position.y()); 274 callback_iter->second.Run(render_view_host, position.x(), position.y());
259 pending_get_render_view_callbacks_.erase(callback_iter); 275 pending_get_render_view_callbacks_.erase(callback_iter);
260 } 276 }
261 277
262 } // namespace content 278 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_embedder.h ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698