| 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/common/extension_api.h" | 5 #include "extensions/common/extension_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 .is_available() || | 296 .is_available() || |
| 297 IsAvailable( | 297 IsAvailable( |
| 298 name, extension, Feature::UNBLESSED_EXTENSION_CONTEXT, GURL()) | 298 name, extension, Feature::UNBLESSED_EXTENSION_CONTEXT, GURL()) |
| 299 .is_available() || | 299 .is_available() || |
| 300 IsAvailable(name, extension, Feature::BLESSED_WEB_PAGE_CONTEXT, GURL()) | 300 IsAvailable(name, extension, Feature::BLESSED_WEB_PAGE_CONTEXT, GURL()) |
| 301 .is_available() || | 301 .is_available() || |
| 302 IsAvailable(name, extension, Feature::WEB_PAGE_CONTEXT, GURL()) | 302 IsAvailable(name, extension, Feature::WEB_PAGE_CONTEXT, GURL()) |
| 303 .is_available(); | 303 .is_available(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool ExtensionAPI::IsAvailableToWebUI(const std::string& name) { | 306 bool ExtensionAPI::IsAvailableToWebUI(const std::string& name, |
| 307 return IsAvailable(name, NULL, Feature::WEBUI_CONTEXT, GURL()).is_available(); | 307 const GURL& url) { |
| 308 return IsAvailable(name, NULL, Feature::WEBUI_CONTEXT, url).is_available(); |
| 308 } | 309 } |
| 309 | 310 |
| 310 const base::DictionaryValue* ExtensionAPI::GetSchema( | 311 const base::DictionaryValue* ExtensionAPI::GetSchema( |
| 311 const std::string& full_name) { | 312 const std::string& full_name) { |
| 312 std::string child_name; | 313 std::string child_name; |
| 313 std::string api_name = GetAPINameFromFullName(full_name, &child_name); | 314 std::string api_name = GetAPINameFromFullName(full_name, &child_name); |
| 314 | 315 |
| 315 const base::DictionaryValue* result = NULL; | 316 const base::DictionaryValue* result = NULL; |
| 316 SchemaMap::iterator maybe_schema = schemas_.find(api_name); | 317 SchemaMap::iterator maybe_schema = schemas_.find(api_name); |
| 317 if (maybe_schema != schemas_.end()) { | 318 if (maybe_schema != schemas_.end()) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 break; | 392 break; |
| 392 | 393 |
| 393 api_name_candidate = api_name_candidate.substr(0, last_dot_index); | 394 api_name_candidate = api_name_candidate.substr(0, last_dot_index); |
| 394 } | 395 } |
| 395 | 396 |
| 396 *child_name = ""; | 397 *child_name = ""; |
| 397 return std::string(); | 398 return std::string(); |
| 398 } | 399 } |
| 399 | 400 |
| 400 } // namespace extensions | 401 } // namespace extensions |
| OLD | NEW |