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

Side by Side Diff: chrome/common/extensions/permissions/permission_set.cc

Issue 10696176: Move UserScript and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq Created 8 years, 5 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/common/extensions/extension_file_util.cc ('k') | chrome/common/extensions/user_script.h » ('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) 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/common/extensions/permissions/permission_set.h" 5 #include "chrome/common/extensions/permissions/permission_set.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <string> 9 #include <string>
10 10
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 499
500 // The webRequest permission implies the internal version as well. 500 // The webRequest permission implies the internal version as well.
501 if (apis_.find(APIPermission::kWebRequest) != apis_.end()) 501 if (apis_.find(APIPermission::kWebRequest) != apis_.end())
502 apis_.insert(APIPermission::kWebRequestInternal); 502 apis_.insert(APIPermission::kWebRequestInternal);
503 503
504 // The fileBrowserHandler permission implies the internal version as well. 504 // The fileBrowserHandler permission implies the internal version as well.
505 if (apis_.find(APIPermission::kFileBrowserHandler) != apis_.end()) 505 if (apis_.find(APIPermission::kFileBrowserHandler) != apis_.end())
506 apis_.insert(APIPermission::kFileBrowserHandlerInternal); 506 apis_.insert(APIPermission::kFileBrowserHandlerInternal);
507 507
508 // Add the scriptable hosts. 508 // Add the scriptable hosts.
509 for (UserScriptList::const_iterator content_script = 509 for (extensions::UserScriptList::const_iterator content_script =
510 extension->content_scripts().begin(); 510 extension->content_scripts().begin();
511 content_script != extension->content_scripts().end(); ++content_script) { 511 content_script != extension->content_scripts().end(); ++content_script) {
512 URLPatternSet::const_iterator pattern = 512 URLPatternSet::const_iterator pattern =
513 content_script->url_patterns().begin(); 513 content_script->url_patterns().begin();
514 for (; pattern != content_script->url_patterns().end(); ++pattern) 514 for (; pattern != content_script->url_patterns().end(); ++pattern)
515 scriptable_hosts_.AddPattern(*pattern); 515 scriptable_hosts_.AddPattern(*pattern);
516 } 516 }
517 } 517 }
518 518
519 void PermissionSet::InitEffectiveHosts() { 519 void PermissionSet::InitEffectiveHosts() {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 std::set<std::string> new_hosts_only; 578 std::set<std::string> new_hosts_only;
579 579
580 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), 580 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
581 old_hosts_set.begin(), old_hosts_set.end(), 581 old_hosts_set.begin(), old_hosts_set.end(),
582 std::inserter(new_hosts_only, new_hosts_only.begin())); 582 std::inserter(new_hosts_only, new_hosts_only.begin()));
583 583
584 return !new_hosts_only.empty(); 584 return !new_hosts_only.empty();
585 } 585 }
586 586
587 } // namespace extensions 587 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/extensions/user_script.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698