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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_api.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 // Implements the Chrome Extensions Cookies API. 5 // Implements the Chrome Extensions Cookies API.
6 6
7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 GURL* url, 55 GURL* url,
56 bool check_host_permissions) { 56 bool check_host_permissions) {
57 *url = GURL(url_string); 57 *url = GURL(url_string);
58 if (!url->is_valid()) { 58 if (!url->is_valid()) {
59 function->SetError( 59 function->SetError(
60 ErrorUtils::FormatErrorMessage(keys::kInvalidUrlError, url_string)); 60 ErrorUtils::FormatErrorMessage(keys::kInvalidUrlError, url_string));
61 return false; 61 return false;
62 } 62 }
63 // Check against host permissions if needed. 63 // Check against host permissions if needed.
64 if (check_host_permissions && 64 if (check_host_permissions &&
65 !PermissionsData::ForExtension(function->GetExtension()) 65 !function->GetExtension()->permissions_data()->HasHostPermission(*url)) {
66 ->HasHostPermission(*url)) {
67 function->SetError(ErrorUtils::FormatErrorMessage( 66 function->SetError(ErrorUtils::FormatErrorMessage(
68 keys::kNoHostPermissionsError, url->spec())); 67 keys::kNoHostPermissionsError, url->spec()));
69 return false; 68 return false;
70 } 69 }
71 return true; 70 return true;
72 } 71 }
73 72
74 bool ParseStoreContext(ChromeAsyncExtensionFunction* function, 73 bool ParseStoreContext(ChromeAsyncExtensionFunction* function,
75 std::string* store_id, 74 std::string* store_id,
76 net::URLRequestContextGetter** context) { 75 net::URLRequestContextGetter** context) {
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 return g_factory.Pointer(); 580 return g_factory.Pointer();
582 } 581 }
583 582
584 void CookiesAPI::OnListenerAdded( 583 void CookiesAPI::OnListenerAdded(
585 const extensions::EventListenerInfo& details) { 584 const extensions::EventListenerInfo& details) {
586 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); 585 cookies_event_router_.reset(new CookiesEventRouter(browser_context_));
587 EventRouter::Get(browser_context_)->UnregisterObserver(this); 586 EventRouter::Get(browser_context_)->UnregisterObserver(this);
588 } 587 }
589 588
590 } // namespace extensions 589 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/commands/command_service.cc ('k') | chrome/browser/extensions/api/cookies/cookies_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698