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

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

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 4 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROMECAST_COMMON_CAST_CONTENT_CLIENT_H_ 5 #ifndef HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_
6 #define CHROMECAST_COMMON_CAST_CONTENT_CLIENT_H_ 6 #define HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_
7 7
8 #include "content/public/common/content_client.h" 8 #include "content/public/common/content_client.h"
9 #include "headless/public/headless_browser.h"
9 10
10 namespace chromecast { 11 namespace headless {
11 namespace shell {
12 12
13 std::string GetUserAgent(); 13 class HeadlessContentClient : public content::ContentClient {
14
15 class CastContentClient : public content::ContentClient {
16 public: 14 public:
17 ~CastContentClient() override; 15 explicit HeadlessContentClient(const HeadlessBrowser::Options& options);
16 ~HeadlessContentClient() override;
18 17
19 // content::ContentClient implementation: 18 // content::ContentClient implementation:
20 void AddAdditionalSchemes(std::vector<url::SchemeWithType>* standard_schemes,
21 std::vector<std::string>* saveable_shemes) override;
22 std::string GetUserAgent() const override; 19 std::string GetUserAgent() const override;
23 base::string16 GetLocalizedString(int message_id) const override; 20 base::string16 GetLocalizedString(int message_id) const override;
24 base::StringPiece GetDataResource( 21 base::StringPiece GetDataResource(
25 int resource_id, 22 int resource_id,
26 ui::ScaleFactor scale_factor) const override; 23 ui::ScaleFactor scale_factor) const override;
27 base::RefCountedStaticMemory* GetDataResourceBytes( 24 base::RefCountedStaticMemory* GetDataResourceBytes(
28 int resource_id) const override; 25 int resource_id) const override;
29 gfx::Image& GetNativeImageNamed(int resource_id) const override; 26 gfx::Image& GetNativeImageNamed(int resource_id) const override;
27
28 private:
29 HeadlessBrowser::Options options_;
30
31 DISALLOW_COPY_AND_ASSIGN(HeadlessContentClient);
30 }; 32 };
31 33
32 } // namespace shell 34 } // namespace headless
33 } // namespace chromecast
34 35
35 #endif // CHROMECAST_COMMON_CAST_CONTENT_CLIENT_H_ 36 #endif // HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698