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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 7003098: Start refractoring extension permissions into ExtensionPermissionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a bad merge Created 9 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698