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

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

Issue 315573003: Remove PermissionsData::ForExtension() completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/extension_tab_util.h" 5 #include "chrome/browser/extensions/extension_tab_util.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 result->SetInteger(keys::kOpenerTabIdKey, GetTabId(opener)); 382 result->SetInteger(keys::kOpenerTabIdKey, GetTabId(opener));
383 } 383 }
384 384
385 return result; 385 return result;
386 } 386 }
387 387
388 void ExtensionTabUtil::ScrubTabValueForExtension( 388 void ExtensionTabUtil::ScrubTabValueForExtension(
389 WebContents* contents, 389 WebContents* contents,
390 const Extension* extension, 390 const Extension* extension,
391 base::DictionaryValue* tab_info) { 391 base::DictionaryValue* tab_info) {
392 bool has_permission = 392 bool has_permission = extension &&
393 extension && 393 extension->permissions_data()->HasAPIPermissionForTab(
394 PermissionsData::ForExtension(extension) 394 GetTabId(contents), APIPermission::kTab);
395 ->HasAPIPermissionForTab(GetTabId(contents), APIPermission::kTab);
396 395
397 if (!has_permission) { 396 if (!has_permission) {
398 tab_info->Remove(keys::kUrlKey, NULL); 397 tab_info->Remove(keys::kUrlKey, NULL);
399 tab_info->Remove(keys::kTitleKey, NULL); 398 tab_info->Remove(keys::kTitleKey, NULL);
400 tab_info->Remove(keys::kFaviconUrlKey, NULL); 399 tab_info->Remove(keys::kFaviconUrlKey, NULL);
401 } 400 }
402 } 401 }
403 402
404 void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension, 403 void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension,
405 api::tabs::Tab* tab) { 404 api::tabs::Tab* tab) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 content::PAGE_TRANSITION_LINK, 570 content::PAGE_TRANSITION_LINK,
572 false); 571 false);
573 browser->OpenURL(params); 572 browser->OpenURL(params);
574 browser->window()->Show(); 573 browser->window()->Show();
575 WebContents* web_contents = 574 WebContents* web_contents =
576 browser->tab_strip_model()->GetActiveWebContents(); 575 browser->tab_strip_model()->GetActiveWebContents();
577 web_contents->GetDelegate()->ActivateContents(web_contents); 576 web_contents->GetDelegate()->ActivateContents(web_contents);
578 } 577 }
579 578
580 } // namespace extensions 579 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698