• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "apps/shell/shell_content_client.h"
6 
7 #include "base/strings/string_piece.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "webkit/common/user_agent/user_agent_util.h"
12 
13 namespace apps {
14 
ShellContentClient()15 ShellContentClient::ShellContentClient() {}
16 
~ShellContentClient()17 ShellContentClient::~ShellContentClient() {}
18 
GetUserAgent() const19 std::string ShellContentClient::GetUserAgent() const {
20   // TODO(derat): Figure out what this should be for app_shell and determine
21   // whether we need to include a version number to placate browser sniffing.
22   return webkit_glue::BuildUserAgentFromProduct("Chrome");
23 }
24 
GetLocalizedString(int message_id) const25 string16 ShellContentClient::GetLocalizedString(int message_id) const {
26   return l10n_util::GetStringUTF16(message_id);
27 }
28 
GetDataResource(int resource_id,ui::ScaleFactor scale_factor) const29 base::StringPiece ShellContentClient::GetDataResource(
30     int resource_id,
31     ui::ScaleFactor scale_factor) const {
32   return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
33       resource_id, scale_factor);
34 }
35 
GetDataResourceBytes(int resource_id) const36 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes(
37     int resource_id) const {
38   return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
39 }
40 
GetNativeImageNamed(int resource_id) const41 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
42   return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
43 }
44 
45 }  // namespace apps
46