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

Side by Side Diff: chrome/browser/extensions/tab_helper.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 "chrome/browser/extensions/tab_helper.h" 5 #include "chrome/browser/extensions/tab_helper.h"
6 6
7 #include "chrome/browser/extensions/activity_log/activity_log.h" 7 #include "chrome/browser/extensions/activity_log/activity_log.h"
8 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" 8 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h"
9 #include "chrome/browser/extensions/api/declarative_content/content_rules_regist ry.h" 9 #include "chrome/browser/extensions/api/declarative_content/content_rules_regist ry.h"
10 #include "chrome/browser/extensions/crx_installer.h" 10 #include "chrome/browser/extensions/crx_installer.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 void TabHelper::OnGetAppInstallState(const GURL& requestor_url, 305 void TabHelper::OnGetAppInstallState(const GURL& requestor_url,
306 int return_route_id, 306 int return_route_id,
307 int callback_id) { 307 int callback_id) {
308 Profile* profile = 308 Profile* profile =
309 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 309 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
310 ExtensionService* extension_service = profile->GetExtensionService(); 310 ExtensionService* extension_service = profile->GetExtensionService();
311 const ExtensionSet* extensions = extension_service->extensions(); 311 const ExtensionSet* extensions = extension_service->extensions();
312 const ExtensionSet* disabled = extension_service->disabled_extensions(); 312 const ExtensionSet* disabled = extension_service->disabled_extensions();
313 313
314 ExtensionURLInfo url(requestor_url);
315 std::string state; 314 std::string state;
316 if (extensions->GetHostedAppByURL(url)) 315 if (extensions->GetHostedAppByURL(requestor_url))
317 state = extension_misc::kAppStateInstalled; 316 state = extension_misc::kAppStateInstalled;
318 else if (disabled->GetHostedAppByURL(url)) 317 else if (disabled->GetHostedAppByURL(requestor_url))
319 state = extension_misc::kAppStateDisabled; 318 state = extension_misc::kAppStateDisabled;
320 else 319 else
321 state = extension_misc::kAppStateNotInstalled; 320 state = extension_misc::kAppStateNotInstalled;
322 321
323 Send(new ExtensionMsg_GetAppInstallStateResponse( 322 Send(new ExtensionMsg_GetAppInstallStateResponse(
324 return_route_id, state, callback_id)); 323 return_route_id, state, callback_id));
325 } 324 }
326 325
327 void TabHelper::OnRequest(const ExtensionHostMsg_Request_Params& request) { 326 void TabHelper::OnRequest(const ExtensionHostMsg_Request_Params& request) {
328 extension_function_dispatcher_.Dispatch(request, 327 extension_function_dispatcher_.Dispatch(request,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 458 }
460 } 459 }
461 460
462 void TabHelper::SetTabId(RenderViewHost* render_view_host) { 461 void TabHelper::SetTabId(RenderViewHost* render_view_host) {
463 render_view_host->Send( 462 render_view_host->Send(
464 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), 463 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(),
465 SessionID::IdForTab(web_contents()))); 464 SessionID::IdForTab(web_contents())));
466 } 465 }
467 466
468 } // namespace extensions 467 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698