Home | History | Annotate | Download | only in shell
      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 
     15 ShellContentClient::ShellContentClient() {}
     16 
     17 ShellContentClient::~ShellContentClient() {}
     18 
     19 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 
     25 string16 ShellContentClient::GetLocalizedString(int message_id) const {
     26   return l10n_util::GetStringUTF16(message_id);
     27 }
     28 
     29 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 
     36 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes(
     37     int resource_id) const {
     38   return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
     39 }
     40 
     41 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
     42   return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
     43 }
     44 
     45 }  // namespace apps
     46