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

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: See if rebasing fixes the tests... 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 &focused)); 541 &focused));
542 542
543 std::string type_str; 543 std::string type_str;
544 if (args->HasKey(keys::kWindowTypeKey)) { 544 if (args->HasKey(keys::kWindowTypeKey)) {
545 EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kWindowTypeKey, 545 EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kWindowTypeKey,
546 &type_str)); 546 &type_str));
547 if (type_str == keys::kWindowTypeValuePopup) { 547 if (type_str == keys::kWindowTypeValuePopup) {
548 window_type = Browser::TYPE_POPUP; 548 window_type = Browser::TYPE_POPUP;
549 app_name = GetExtension()->id(); 549 app_name = GetExtension()->id();
550 } else if (type_str == keys::kWindowTypeValuePanel) { 550 } else if (type_str == keys::kWindowTypeValuePanel) {
551 if (GetExtension()->HasApiPermission( 551 if (GetExtension()->HasAPIPermission(
552 Extension::kExperimentalPermission)) { 552 ExtensionAPIPermission::kExperimental)) {
553 window_type = Browser::TYPE_PANEL; 553 window_type = Browser::TYPE_PANEL;
554 app_name = GetExtension()->id(); 554 app_name = GetExtension()->id();
555 } else { 555 } else {
556 error_ = errors::kExperimentalFeature; 556 error_ = errors::kExperimentalFeature;
557 return false; 557 return false;
558 } 558 }
559 } else if (type_str != keys::kWindowTypeValueNormal) { 559 } else if (type_str != keys::kWindowTypeValueNormal) {
560 EXTENSION_FUNCTION_VALIDATE(false); 560 EXTENSION_FUNCTION_VALIDATE(false);
561 } 561 }
562 } 562 }
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 // called for every API call the extension made. 1369 // called for every API call the extension made.
1370 GotLanguage(language); 1370 GotLanguage(language);
1371 } 1371 }
1372 1372
1373 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1373 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1374 result_.reset(Value::CreateStringValue(language.c_str())); 1374 result_.reset(Value::CreateStringValue(language.c_str()));
1375 SendResponse(true); 1375 SendResponse(true);
1376 1376
1377 Release(); // Balanced in Run() 1377 Release(); // Balanced in Run()
1378 } 1378 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698