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

Side by Side Diff: chrome/common/extensions/api/url_parser/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: Created 7 years, 12 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/api/url_parser/devtools_page_handler.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/utf_string_conversions.h"
Yoyo Zhou 2012/12/27 17:16:17 Make sure you only include what you use.
Joe Thomas 2012/12/30 04:26:00 ASCIIToUTF16 which is used in DevToolsPageHandler:
Yoyo Zhou 2013/01/03 01:45:54 Ah, sorry. Thanks for paying more attention than m
9 #include "base/values.h"
10 #include "chrome/common/extensions/api/url_parser/url_info.h"
11 #include "chrome/common/extensions/extension_manifest_constants.h"
12 #include "extensions/common/error_utils.h"
13
14 namespace keys = extension_manifest_keys;
15 namespace errors = extension_manifest_errors;
16
17 namespace extensions {
18
19 DevToolsPageHandler::DevToolsPageHandler() {
20 }
21
22 DevToolsPageHandler::~DevToolsPageHandler() {
23 }
24
25 bool DevToolsPageHandler::Parse(const base::Value* value,
26 Extension* extension,
27 string16* error) {
28 scoped_ptr<URLInfo> info(new URLInfo);
29 std::string devtools_str;
30 if (!value->GetAsString(&devtools_str)) {
31 *error = ASCIIToUTF16(errors::kInvalidDevToolsPage);
32 return false;
33 }
34 info->url_ = extension->GetResourceURL(devtools_str);
35 extension->SetManifestData(keys::kDevToolsPage, info.release());
36 return true;
37 }
38
39 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698