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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs.cc

Issue 10675007: Move each permission classes to its own files in extensions/permissions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase again Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/tabs/tabs.h" 5 #include "chrome/browser/extensions/api/tabs/tabs.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 if (!url.SchemeIs(chrome::kJavaScriptScheme)) 1346 if (!url.SchemeIs(chrome::kJavaScriptScheme))
1347 DCHECK_EQ(url.spec(), tab_contents_->web_contents()->GetURL().spec()); 1347 DCHECK_EQ(url.spec(), tab_contents_->web_contents()->GetURL().spec());
1348 1348
1349 return true; 1349 return true;
1350 } 1350 }
1351 1351
1352 void UpdateTabFunction::PopulateResult() { 1352 void UpdateTabFunction::PopulateResult() {
1353 if (!has_callback()) 1353 if (!has_callback())
1354 return; 1354 return;
1355 1355
1356 if (GetExtension()->HasAPIPermission(ExtensionAPIPermission::kTab)) { 1356 if (GetExtension()->HasAPIPermission(extensions::APIPermission::kTab)) {
1357 result_.reset( 1357 result_.reset(
1358 ExtensionTabUtil::CreateTabValue(tab_contents_->web_contents())); 1358 ExtensionTabUtil::CreateTabValue(tab_contents_->web_contents()));
1359 } else { 1359 } else {
1360 result_.reset(Value::CreateNullValue()); 1360 result_.reset(Value::CreateNullValue());
1361 } 1361 }
1362 } 1362 }
1363 1363
1364 void UpdateTabFunction::OnExecuteCodeFinished(bool success, 1364 void UpdateTabFunction::OnExecuteCodeFinished(bool success,
1365 int32 page_id, 1365 int32 page_id,
1366 const std::string& error) { 1366 const std::string& error) {
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 // called for every API call the extension made. 1825 // called for every API call the extension made.
1826 GotLanguage(language); 1826 GotLanguage(language);
1827 } 1827 }
1828 1828
1829 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1829 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1830 result_.reset(Value::CreateStringValue(language.c_str())); 1830 result_.reset(Value::CreateStringValue(language.c_str()));
1831 SendResponse(true); 1831 SendResponse(true);
1832 1832
1833 Release(); // Balanced in Run() 1833 Release(); // Balanced in Run()
1834 } 1834 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698