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

Unified Diff: chrome/common/extensions/extension.cc

Issue 9006027: Rip Out the Sidebar API (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 116830)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -32,8 +32,6 @@
#include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_l10n_util.h"
#include "chrome/common/extensions/extension_resource.h"
-#include "chrome/common/extensions/extension_sidebar_defaults.h"
-#include "chrome/common/extensions/extension_sidebar_utils.h"
#include "chrome/common/extensions/file_browser_handler.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/common/extensions/user_script.h"
@@ -202,7 +200,6 @@
const int Extension::kPageActionIconMaxSize = 19;
const int Extension::kBrowserActionIconMaxSize = 19;
-const int Extension::kSidebarIconMaxSize = 16;
const int Extension::kValidWebExtentSchemes =
URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS;
@@ -862,56 +859,6 @@
return result.release();
}
-ExtensionSidebarDefaults* Extension::LoadExtensionSidebarDefaults(
- const DictionaryValue* extension_sidebar, string16* error) {
- scoped_ptr<ExtensionSidebarDefaults> result(new ExtensionSidebarDefaults());
-
- std::string default_icon;
- // Read sidebar's |default_icon| (optional).
- if (extension_sidebar->HasKey(keys::kSidebarDefaultIcon)) {
- if (!extension_sidebar->GetString(keys::kSidebarDefaultIcon,
- &default_icon) ||
- default_icon.empty()) {
- *error = ASCIIToUTF16(errors::kInvalidSidebarDefaultIconPath);
- return NULL;
- }
- result->set_default_icon_path(default_icon);
- }
-
- // Read sidebar's |default_title| (optional).
- string16 default_title;
- if (extension_sidebar->HasKey(keys::kSidebarDefaultTitle)) {
- if (!extension_sidebar->GetString(keys::kSidebarDefaultTitle,
- &default_title)) {
- *error = ASCIIToUTF16(errors::kInvalidSidebarDefaultTitle);
- return NULL;
- }
- }
- result->set_default_title(default_title);
-
- // Read sidebar's |default_page| (optional).
- // TODO(rdevlin.cronin): Continue removing std::string errors and replace
- // with string16
- std::string default_page;
- std::string utf8_error;
- if (extension_sidebar->HasKey(keys::kSidebarDefaultPage)) {
- if (!extension_sidebar->GetString(keys::kSidebarDefaultPage,
- &default_page) ||
- default_page.empty()) {
- *error = ASCIIToUTF16(errors::kInvalidSidebarDefaultPage);
- return NULL;
- }
- GURL url = extension_sidebar_utils::ResolveRelativePath(
- default_page, this, &utf8_error);
- *error = UTF8ToUTF16(utf8_error);
- if (!url.is_valid())
- return NULL;
- result->set_default_page(url);
- }
-
- return result.release();
-}
-
bool Extension::LoadExtent(const extensions::Manifest* manifest,
const char* key,
URLPatternSet* extent,
@@ -2254,22 +2201,6 @@
devtools_url_ = GetResourceURL(devtools_str);
}
- // Initialize sidebar action (optional).
- if (manifest->HasKey(keys::kSidebar)) {
- DictionaryValue* sidebar_value = NULL;
- if (!manifest->GetDictionary(keys::kSidebar, &sidebar_value)) {
- *error = ASCIIToUTF16(errors::kInvalidSidebar);
- return false;
- }
- if (!api_permissions.count(ExtensionAPIPermission::kExperimental)) {
- *error = ASCIIToUTF16(errors::kSidebarExperimental);
- return false;
- }
- sidebar_defaults_.reset(LoadExtensionSidebarDefaults(sidebar_value, error));
- if (!sidebar_defaults_.get())
- return false; // Failed to parse sidebar definition.
- }
-
// Initialize text-to-speech voices (optional).
if (manifest->HasKey(keys::kTtsEngine)) {
DictionaryValue* tts_dict = NULL;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698