OLD | NEW |
1 // Copyright 2015 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 HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ | 5 #ifndef HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ |
6 #define HEADLESS_LIB_HEADLESS_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 #include "headless/public/headless_browser.h" |
10 | 10 |
11 namespace headless { | 11 namespace headless { |
12 | 12 |
13 class HeadlessContentClient : public content::ContentClient { | 13 class HeadlessContentClient : public content::ContentClient { |
14 public: | 14 public: |
15 explicit HeadlessContentClient(HeadlessBrowser::Options* options); | 15 explicit HeadlessContentClient(HeadlessBrowser::Options* options); |
16 ~HeadlessContentClient() override; | 16 ~HeadlessContentClient() override; |
17 | 17 |
18 // content::ContentClient implementation: | 18 // content::ContentClient implementation: |
| 19 std::string GetProduct() const override; |
19 std::string GetUserAgent() const override; | 20 std::string GetUserAgent() const override; |
20 base::string16 GetLocalizedString(int message_id) const override; | 21 base::string16 GetLocalizedString(int message_id) const override; |
21 base::StringPiece GetDataResource( | 22 base::StringPiece GetDataResource( |
22 int resource_id, | 23 int resource_id, |
23 ui::ScaleFactor scale_factor) const override; | 24 ui::ScaleFactor scale_factor) const override; |
24 base::RefCountedMemory* GetDataResourceBytes( | 25 base::RefCountedMemory* GetDataResourceBytes( |
25 int resource_id) const override; | 26 int resource_id) const override; |
26 gfx::Image& GetNativeImageNamed(int resource_id) const override; | 27 gfx::Image& GetNativeImageNamed(int resource_id) const override; |
27 | 28 |
28 private: | 29 private: |
29 HeadlessBrowser::Options* options_; // Not owned. | 30 HeadlessBrowser::Options* options_; // Not owned. |
30 | 31 |
31 DISALLOW_COPY_AND_ASSIGN(HeadlessContentClient); | 32 DISALLOW_COPY_AND_ASSIGN(HeadlessContentClient); |
32 }; | 33 }; |
33 | 34 |
34 } // namespace headless | 35 } // namespace headless |
35 | 36 |
36 #endif // HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ | 37 #endif // HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ |
OLD | NEW |