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

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

Issue 228603004: Move manifest_handler_helpers to //extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/manifest_handler_helpers.cc
diff --git a/chrome/common/extensions/manifest_handler_helpers.cc b/chrome/common/extensions/manifest_handler_helpers.cc
deleted file mode 100644
index 5c6a9d2340ea99dd661aafbdc9158d037b79ddc3..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/manifest_handler_helpers.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/extensions/manifest_handler_helpers.h"
-
-#include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
-#include "extensions/common/error_utils.h"
-#include "extensions/common/extension.h"
-#include "extensions/common/extension_icon_set.h"
-#include "extensions/common/manifest_constants.h"
-
-
-namespace extensions {
-
-namespace errors = manifest_errors;
-
-namespace manifest_handler_helpers {
-
-bool NormalizeAndValidatePath(std::string* path) {
- size_t first_non_slash = path->find_first_not_of('/');
- if (first_non_slash == std::string::npos) {
- *path = "";
- return false;
- }
-
- *path = path->substr(first_non_slash);
- return true;
-}
-
-bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value,
- const int* icon_sizes,
- size_t num_icon_sizes,
- ExtensionIconSet* icons,
- base::string16* error) {
- DCHECK(icons);
- for (size_t i = 0; i < num_icon_sizes; ++i) {
- std::string key = base::IntToString(icon_sizes[i]);
- if (icons_value->HasKey(key)) {
- std::string icon_path;
- if (!icons_value->GetString(key, &icon_path)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidIconPath, key);
- return false;
- }
-
- if (!NormalizeAndValidatePath(&icon_path)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidIconPath, key);
- return false;
- }
-
- icons->Add(icon_sizes[i], icon_path);
- }
- }
- return true;
-}
-
-} // namespace manifest_handler_helpers
-
-} // namespace extensions
« no previous file with comments | « chrome/common/extensions/manifest_handler_helpers.h ('k') | chrome/common/extensions/manifest_handlers/icons_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698