| OLD | NEW |
| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/public/browser/notification_source.h" | 8 #include "content/public/browser/notification_source.h" |
| 9 #include "content/public/browser/notification_types.h" | 9 #include "content/public/browser/notification_types.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return NULL; | 182 return NULL; |
| 183 } | 183 } |
| 184 | 184 |
| 185 IOThreadExtensionFunction* ExtensionFunction::AsIOThreadExtensionFunction() { | 185 IOThreadExtensionFunction* ExtensionFunction::AsIOThreadExtensionFunction() { |
| 186 return NULL; | 186 return NULL; |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool ExtensionFunction::HasPermission() { | 189 bool ExtensionFunction::HasPermission() { |
| 190 Feature::Availability availability = | 190 Feature::Availability availability = |
| 191 ExtensionAPI::GetSharedInstance()->IsAvailable( | 191 ExtensionAPI::GetSharedInstance()->IsAvailable( |
| 192 name_, extension_, source_context_type_, source_url()); | 192 name_, extension_.get(), source_context_type_, source_url()); |
| 193 return availability.is_available(); | 193 return availability.is_available(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void ExtensionFunction::OnQuotaExceeded(const std::string& violation_error) { | 196 void ExtensionFunction::OnQuotaExceeded(const std::string& violation_error) { |
| 197 error_ = violation_error; | 197 error_ = violation_error; |
| 198 SendResponse(false); | 198 SendResponse(false); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void ExtensionFunction::SetArgs(const base::ListValue* args) { | 201 void ExtensionFunction::SetArgs(const base::ListValue* args) { |
| 202 DCHECK(!args_.get()); // Should only be called once. | 202 DCHECK(!args_.get()); // Should only be called once. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 481 |
| 482 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { | 482 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { |
| 483 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); | 483 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); |
| 484 } | 484 } |
| 485 | 485 |
| 486 // static | 486 // static |
| 487 bool SyncIOThreadExtensionFunction::ValidationFailure( | 487 bool SyncIOThreadExtensionFunction::ValidationFailure( |
| 488 SyncIOThreadExtensionFunction* function) { | 488 SyncIOThreadExtensionFunction* function) { |
| 489 return false; | 489 return false; |
| 490 } | 490 } |
| OLD | NEW |