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

Side by Side Diff: extensions/browser/extension_function.cc

Issue 2494653005: Support API aliases (Closed)
Patch Set: rebase Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/extension_function.h" 5 #include "extensions/browser/extension_function.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return NULL; 283 return NULL;
284 } 284 }
285 285
286 IOThreadExtensionFunction* ExtensionFunction::AsIOThreadExtensionFunction() { 286 IOThreadExtensionFunction* ExtensionFunction::AsIOThreadExtensionFunction() {
287 return NULL; 287 return NULL;
288 } 288 }
289 289
290 bool ExtensionFunction::HasPermission() { 290 bool ExtensionFunction::HasPermission() {
291 Feature::Availability availability = 291 Feature::Availability availability =
292 ExtensionAPI::GetSharedInstance()->IsAvailable( 292 ExtensionAPI::GetSharedInstance()->IsAvailable(
293 name_, extension_.get(), source_context_type_, source_url()); 293 name_, extension_.get(), source_context_type_, source_url(), true);
294 return availability.is_available(); 294 return availability.is_available();
295 } 295 }
296 296
297 void ExtensionFunction::OnQuotaExceeded(const std::string& violation_error) { 297 void ExtensionFunction::OnQuotaExceeded(const std::string& violation_error) {
298 error_ = violation_error; 298 error_ = violation_error;
299 SendResponseImpl(false); 299 SendResponseImpl(false);
300 } 300 }
301 301
302 void ExtensionFunction::SetArgs(const base::ListValue* args) { 302 void ExtensionFunction::SetArgs(const base::ListValue* args) {
303 DCHECK(!args_.get()); // Should only be called once. 303 DCHECK(!args_.get()); // Should only be called once.
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 void AsyncExtensionFunction::SendResponse(bool success) { 616 void AsyncExtensionFunction::SendResponse(bool success) {
617 ResponseValue response; 617 ResponseValue response;
618 if (success) { 618 if (success) {
619 response = ArgumentList(std::move(results_)); 619 response = ArgumentList(std::move(results_));
620 } else { 620 } else {
621 response = results_ ? ErrorWithArguments(std::move(results_), error_) 621 response = results_ ? ErrorWithArguments(std::move(results_), error_)
622 : Error(error_); 622 : Error(error_);
623 } 623 }
624 Respond(std::move(response)); 624 Respond(std::move(response));
625 } 625 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698