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

Side by Side Diff: headless/lib/headless_content_client.cc

Issue 1430673002: Headless demo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better javascript Created 5 years 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
« no previous file with comments | « headless/lib/headless_content_client.h ('k') | headless/lib/headless_shell_main_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 "headless/lib/headless_content_client.h"
6
7 #include "ui/base/l10n/l10n_util.h"
8 #include "ui/base/resource/resource_bundle.h"
9
10 namespace headless {
11
12 HeadlessContentClient::~HeadlessContentClient() { }
13
14 std::string HeadlessContentClient::GetUserAgent() const {
15 // TODO(altimin): forward this value from browser.
16 return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36";
17 }
18
19 base::string16 HeadlessContentClient::GetLocalizedString(int message_id) const {
20 return l10n_util::GetStringUTF16(message_id);
21 }
22
23 base::StringPiece HeadlessContentClient::GetDataResource(
24 int resource_id,
25 ui::ScaleFactor scale_factor) const {
26 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
27 resource_id, scale_factor);
28 }
29
30 base::RefCountedStaticMemory* HeadlessContentClient::GetDataResourceBytes(
31 int resource_id) const {
32 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
33 }
34
35 gfx::Image& HeadlessContentClient::GetNativeImageNamed(int resource_id) const {
36 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
37 }
38
39 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/headless_content_client.h ('k') | headless/lib/headless_shell_main_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698