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

Side by Side Diff: chrome/renderer/render_thread.cc

Issue 164039: Add module-level permissions to extensions. (Closed)
Patch Set: final nits Created 11 years, 4 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
« no previous file with comments | « chrome/renderer/render_thread.h ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/renderer/render_thread.h" 5 #include "chrome/renderer/render_thread.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 const std::vector<std::string>& names) { 194 const std::vector<std::string>& names) {
195 ExtensionProcessBindings::SetFunctionNames(names); 195 ExtensionProcessBindings::SetFunctionNames(names);
196 } 196 }
197 197
198 void RenderThread::OnPageActionsUpdated( 198 void RenderThread::OnPageActionsUpdated(
199 const std::string& extension_id, 199 const std::string& extension_id,
200 const std::vector<std::string>& page_actions) { 200 const std::vector<std::string>& page_actions) {
201 ExtensionProcessBindings::SetPageActions(extension_id, page_actions); 201 ExtensionProcessBindings::SetPageActions(extension_id, page_actions);
202 } 202 }
203 203
204 void RenderThread::OnExtensionSetPermissions(
205 const std::string& extension_id,
206 const std::vector<std::string>& permissions) {
207 ExtensionProcessBindings::SetPermissions(extension_id, permissions);
208 }
209
204 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { 210 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) {
205 // App cache messages are handled by a delegate. 211 // App cache messages are handled by a delegate.
206 if (app_cache_dispatcher_->OnMessageReceived(msg)) 212 if (app_cache_dispatcher_->OnMessageReceived(msg))
207 return; 213 return;
208 214
209 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) 215 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg)
210 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) 216 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks)
211 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Add, OnAddVisitedLinks) 217 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Add, OnAddVisitedLinks)
212 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Reset, OnResetVisitedLinks) 218 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Reset, OnResetVisitedLinks)
213 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) 219 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID)
(...skipping 10 matching lines...) Expand all
224 // TODO(rafaelw): create an ExtensionDispatcher that handles extension 230 // TODO(rafaelw): create an ExtensionDispatcher that handles extension
225 // messages seperates their handling from the RenderThread. 231 // messages seperates their handling from the RenderThread.
226 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionMessageInvoke, 232 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionMessageInvoke,
227 OnExtensionMessageInvoke) 233 OnExtensionMessageInvoke)
228 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetFunctionNames, 234 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetFunctionNames,
229 OnSetExtensionFunctionNames) 235 OnSetExtensionFunctionNames)
230 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, 236 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache,
231 OnPurgePluginListCache) 237 OnPurgePluginListCache)
232 IPC_MESSAGE_HANDLER(ViewMsg_Extension_UpdatePageActions, 238 IPC_MESSAGE_HANDLER(ViewMsg_Extension_UpdatePageActions,
233 OnPageActionsUpdated) 239 OnPageActionsUpdated)
240 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetPermissions,
241 OnExtensionSetPermissions)
234 IPC_END_MESSAGE_MAP() 242 IPC_END_MESSAGE_MAP()
235 } 243 }
236 244
237 void RenderThread::OnSetNextPageID(int32 next_page_id) { 245 void RenderThread::OnSetNextPageID(int32 next_page_id) {
238 // This should only be called at process initialization time, so we shouldn't 246 // This should only be called at process initialization time, so we shouldn't
239 // have to worry about thread-safety. 247 // have to worry about thread-safety.
240 RenderView::SetNextPageID(next_page_id); 248 RenderView::SetNextPageID(next_page_id);
241 } 249 }
242 250
243 void RenderThread::OnCreateNewView(gfx::NativeViewId parent_hwnd, 251 void RenderThread::OnCreateNewView(gfx::NativeViewId parent_hwnd,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 407
400 void RenderThread::OnPurgePluginListCache() { 408 void RenderThread::OnPurgePluginListCache() {
401 // The call below will cause a GetPlugins call with refresh=true, but at this 409 // The call below will cause a GetPlugins call with refresh=true, but at this
402 // point we already know that the browser has refreshed its list, so disable 410 // point we already know that the browser has refreshed its list, so disable
403 // refresh temporarily to prevent each renderer process causing the list to be 411 // refresh temporarily to prevent each renderer process causing the list to be
404 // regenerated. 412 // regenerated.
405 plugin_refresh_allowed_ = false; 413 plugin_refresh_allowed_ = false;
406 WebKit::resetPluginCache(); 414 WebKit::resetPluginCache();
407 plugin_refresh_allowed_ = true; 415 plugin_refresh_allowed_ = true;
408 } 416 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_thread.h ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698