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

Side by Side Diff: extensions/shell/common/shell_content_client.cc

Issue 412713002: Move apps/shell to extensions/shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 40% Created 6 years, 5 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "apps/shell/common/shell_content_client.h" 5 #include "extensions/shell/common/shell_content_client.h"
6 6
7 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/common/user_agent.h" 9 #include "content/public/common/user_agent.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
11 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
12 #include "ui/base/resource/resource_bundle.h" 12 #include "ui/base/resource/resource_bundle.h"
13 13
14 namespace apps { 14 namespace extensions {
15 15
16 ShellContentClient::ShellContentClient() {} 16 ShellContentClient::ShellContentClient() {
17 }
17 18
18 ShellContentClient::~ShellContentClient() {} 19 ShellContentClient::~ShellContentClient() {
20 }
19 21
20 void ShellContentClient::AddAdditionalSchemes( 22 void ShellContentClient::AddAdditionalSchemes(
21 std::vector<std::string>* standard_schemes, 23 std::vector<std::string>* standard_schemes,
22 std::vector<std::string>* savable_schemes) { 24 std::vector<std::string>* savable_schemes) {
23 standard_schemes->push_back(extensions::kExtensionScheme); 25 standard_schemes->push_back(kExtensionScheme);
24 savable_schemes->push_back(extensions::kExtensionScheme); 26 savable_schemes->push_back(kExtensionScheme);
25 standard_schemes->push_back(extensions::kExtensionResourceScheme); 27 standard_schemes->push_back(kExtensionResourceScheme);
26 savable_schemes->push_back(extensions::kExtensionResourceScheme); 28 savable_schemes->push_back(kExtensionResourceScheme);
27 } 29 }
28 30
29 std::string ShellContentClient::GetUserAgent() const { 31 std::string ShellContentClient::GetUserAgent() const {
30 // TODO(derat): Figure out what this should be for app_shell and determine 32 // TODO(derat): Figure out what this should be for app_shell and determine
31 // whether we need to include a version number to placate browser sniffing. 33 // whether we need to include a version number to placate browser sniffing.
32 return content::BuildUserAgentFromProduct("Chrome"); 34 return content::BuildUserAgentFromProduct("Chrome");
33 } 35 }
34 36
35 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { 37 base::string16 ShellContentClient::GetLocalizedString(int message_id) const {
36 return l10n_util::GetStringUTF16(message_id); 38 return l10n_util::GetStringUTF16(message_id);
37 } 39 }
38 40
39 base::StringPiece ShellContentClient::GetDataResource( 41 base::StringPiece ShellContentClient::GetDataResource(
40 int resource_id, 42 int resource_id,
41 ui::ScaleFactor scale_factor) const { 43 ui::ScaleFactor scale_factor) const {
42 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( 44 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
43 resource_id, scale_factor); 45 resource_id, scale_factor);
44 } 46 }
45 47
46 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( 48 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes(
47 int resource_id) const { 49 int resource_id) const {
48 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); 50 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
49 } 51 }
50 52
51 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { 53 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
52 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); 54 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
53 } 55 }
54 56
55 } // namespace apps 57 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/common/shell_content_client.h ('k') | extensions/shell/common/shell_extensions_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698