| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/extensions/extension_tabs_module.h" | 5 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 523 |
| 524 std::string type_str; | 524 std::string type_str; |
| 525 if (args->HasKey(keys::kWindowTypeKey)) { | 525 if (args->HasKey(keys::kWindowTypeKey)) { |
| 526 EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kWindowTypeKey, | 526 EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kWindowTypeKey, |
| 527 &type_str)); | 527 &type_str)); |
| 528 if (type_str == keys::kWindowTypeValuePopup) { | 528 if (type_str == keys::kWindowTypeValuePopup) { |
| 529 window_type = Browser::TYPE_POPUP; | 529 window_type = Browser::TYPE_POPUP; |
| 530 app_name = GetExtension()->id(); | 530 app_name = GetExtension()->id(); |
| 531 } else if (type_str == keys::kWindowTypeValuePanel) { | 531 } else if (type_str == keys::kWindowTypeValuePanel) { |
| 532 if (GetExtension()->HasApiPermission( | 532 if (GetExtension()->HasApiPermission( |
| 533 Extension::kExperimentalPermission)) { | 533 ExtensionAPIPermission::Experimental())) { |
| 534 window_type = Browser::TYPE_PANEL; | 534 window_type = Browser::TYPE_PANEL; |
| 535 app_name = GetExtension()->id(); | 535 app_name = GetExtension()->id(); |
| 536 } else { | 536 } else { |
| 537 error_ = errors::kExperimentalFeature; | 537 error_ = errors::kExperimentalFeature; |
| 538 return false; | 538 return false; |
| 539 } | 539 } |
| 540 } else if (type_str != keys::kWindowTypeValueNormal) { | 540 } else if (type_str != keys::kWindowTypeValueNormal) { |
| 541 EXTENSION_FUNCTION_VALIDATE(false); | 541 EXTENSION_FUNCTION_VALIDATE(false); |
| 542 } | 542 } |
| 543 } | 543 } |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 // called for every API call the extension made. | 1350 // called for every API call the extension made. |
| 1351 GotLanguage(language); | 1351 GotLanguage(language); |
| 1352 } | 1352 } |
| 1353 | 1353 |
| 1354 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1354 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
| 1355 result_.reset(Value::CreateStringValue(language.c_str())); | 1355 result_.reset(Value::CreateStringValue(language.c_str())); |
| 1356 SendResponse(true); | 1356 SendResponse(true); |
| 1357 | 1357 |
| 1358 Release(); // Balanced in Run() | 1358 Release(); // Balanced in Run() |
| 1359 } | 1359 } |
| OLD | NEW |