skyostil | fe11616 | 2016-02-26 20:53:33 | [diff] [blame] | 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 | #ifndef HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ |
| 6 | #define HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ |
| 7 | |
| 8 | #include "content/public/common/content_client.h" |
| 9 | #include "headless/public/headless_browser.h" |
| 10 | |
| 11 | namespace headless { |
| 12 | |
| 13 | class HeadlessContentClient : public content::ContentClient { |
| 14 | public: |
skyostil | b5ee7120 | 2016-05-25 11:54:22 | [diff] [blame] | 15 | explicit HeadlessContentClient(HeadlessBrowser::Options* options); |
skyostil | fe11616 | 2016-02-26 20:53:33 | [diff] [blame] | 16 | ~HeadlessContentClient() override; |
| 17 | |
| 18 | // content::ContentClient implementation: |
eseckler | 38ff88e | 2017-02-27 11:17:18 | [diff] [blame] | 19 | std::string GetProduct() const override; |
skyostil | fe11616 | 2016-02-26 20:53:33 | [diff] [blame] | 20 | std::string GetUserAgent() const override; |
| 21 | base::string16 GetLocalizedString(int message_id) const override; |
| 22 | base::StringPiece GetDataResource( |
| 23 | int resource_id, |
| 24 | ui::ScaleFactor scale_factor) const override; |
smaier | a737aa3a | 2016-05-25 20:17:57 | [diff] [blame] | 25 | base::RefCountedMemory* GetDataResourceBytes( |
skyostil | fe11616 | 2016-02-26 20:53:33 | [diff] [blame] | 26 | int resource_id) const override; |
| 27 | gfx::Image& GetNativeImageNamed(int resource_id) const override; |
| 28 | |
| 29 | private: |
skyostil | b5ee7120 | 2016-05-25 11:54:22 | [diff] [blame] | 30 | HeadlessBrowser::Options* options_; // Not owned. |
skyostil | fe11616 | 2016-02-26 20:53:33 | [diff] [blame] | 31 | |
| 32 | DISALLOW_COPY_AND_ASSIGN(HeadlessContentClient); |
| 33 | }; |
| 34 | |
| 35 | } // namespace headless |
| 36 | |
| 37 | #endif // HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ |