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

Side by Side Diff: chrome/common/extensions/extension_sidebar_utils.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/extension_sidebar_utils.h"
6
7 #include "chrome/common/extensions/extension.h"
8 #include "chrome/common/extensions/extension_error_utils.h"
9 #include "googleurl/src/gurl.h"
10
11 namespace {
12
13 // Errors.
14 const char kInvalidPathError[] = "Invalid path: \"*\".";
15
16 } // namespace
17
18 namespace extension_sidebar_utils {
19
20 std::string GetExtensionIdByContentId(const std::string& content_id) {
21 // At the moment, content_id == extension_id.
22 return content_id;
23 }
24
25 GURL ResolveRelativePath(const std::string& relative_path,
26 const Extension* extension,
27 std::string* error) {
28 GURL url(extension->GetResourceURL(relative_path));
29 if (!url.is_valid()) {
30 *error = ExtensionErrorUtils::FormatErrorMessage(kInvalidPathError,
31 relative_path);
32 return GURL();
33 }
34 return url;
35 }
36
37 } // namespace extension_sidebar_utils
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_sidebar_utils.h ('k') | chrome/common/extensions/manifest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698