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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 6749021: Added new fileBrowserPrivate and fileHandler extension APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 *error = ExtensionErrorUtils::FormatErrorMessage( 1902 *error = ExtensionErrorUtils::FormatErrorMessage(
1903 errors::kInvalidPermission, base::IntToString(i)); 1903 errors::kInvalidPermission, base::IntToString(i));
1904 return false; 1904 return false;
1905 } 1905 }
1906 1906
1907 // Only COMPONENT extensions can use the webstorePrivate and 1907 // Only COMPONENT extensions can use the webstorePrivate and
1908 // fileBrowserPrivate APIs. 1908 // fileBrowserPrivate APIs.
1909 // TODO(asargent) - We want a more general purpose mechanism for this, 1909 // TODO(asargent) - We want a more general purpose mechanism for this,
1910 // and better error messages. (http://crbug.com/54013) 1910 // and better error messages. (http://crbug.com/54013)
1911 if ((permission_str == kWebstorePrivatePermission || 1911 if ((permission_str == kWebstorePrivatePermission ||
1912 permission_str == kChromeosInfoPrivatePermissions ||
1912 permission_str == kFileBrowserPrivatePermission) && 1913 permission_str == kFileBrowserPrivatePermission) &&
1913 location_ != Extension::COMPONENT) { 1914 (location_ != Extension::COMPONENT
1914 continue; 1915 #ifndef NDEBUG
1915 } 1916 && !CommandLine::ForCurrentProcess()->HasSwitch(
1916 1917 switches::kExposePrivateExtensionApi)
1917 if (permission_str == kChromeosInfoPrivatePermissions && 1918 #endif
1918 location_ != Extension::COMPONENT) { 1919 )) {
1919 continue; 1920 continue;
1920 } 1921 }
1921 1922
1922 // Remap the old unlimited storage permission name. 1923 // Remap the old unlimited storage permission name.
1923 if (permission_str == kOldUnlimitedStoragePermission) 1924 if (permission_str == kOldUnlimitedStoragePermission)
1924 permission_str = kUnlimitedStoragePermission; 1925 permission_str = kUnlimitedStoragePermission;
1925 1926
1926 if (web_extent().is_empty() || location() == Extension::COMPONENT) { 1927 if (web_extent().is_empty() || location() == Extension::COMPONENT) {
1927 // Check if it's a module permission. If so, enable that permission. 1928 // Check if it's a module permission. If so, enable that permission.
1928 if (IsAPIPermission(permission_str)) { 1929 if (IsAPIPermission(permission_str)) {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 2561
2561 UninstalledExtensionInfo::~UninstalledExtensionInfo() {} 2562 UninstalledExtensionInfo::~UninstalledExtensionInfo() {}
2562 2563
2563 2564
2564 UnloadedExtensionInfo::UnloadedExtensionInfo( 2565 UnloadedExtensionInfo::UnloadedExtensionInfo(
2565 const Extension* extension, 2566 const Extension* extension,
2566 Reason reason) 2567 Reason reason)
2567 : reason(reason), 2568 : reason(reason),
2568 already_disabled(false), 2569 already_disabled(false),
2569 extension(extension) {} 2570 extension(extension) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698