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

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

Issue 11624036: Move the parsing of homepage_url" and "devtools_page" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments addressed Created 8 years 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/devtools_page_handler.cc
diff --git a/chrome/common/extensions/devtools_page_handler.cc b/chrome/common/extensions/devtools_page_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..caebed47f673a5856403768beec76e881b304c04
--- /dev/null
+++ b/chrome/common/extensions/devtools_page_handler.cc
@@ -0,0 +1,39 @@
+// 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/devtools_page_handler.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
+#include "base/values.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_url_info.h"
+#include "extensions/common/error_utils.h"
+
+namespace keys = extension_manifest_keys;
+namespace errors = extension_manifest_errors;
+
+namespace extensions {
+
+DevToolsPageHandler::DevToolsPageHandler() {
+}
+
+DevToolsPageHandler::~DevToolsPageHandler() {
+}
+
+bool DevToolsPageHandler::Parse(const base::Value* value,
+ Extension* extension,
+ string16* error) {
+ scoped_ptr<ManifestURLInfo> info(new ManifestURLInfo);
+ std::string devtools_str;
+ if (!value->GetAsString(&devtools_str)) {
+ *error = ASCIIToUTF16(errors::kInvalidDevToolsPage);
+ return false;
+ }
+ info->url_ = extension->GetResourceURL(devtools_str);
+ extension->SetManifestData(keys::kDevToolsPage, info.release());
+ return true;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698