Chromium Code Reviews| 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_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <unordered_map> | 11 #include <unordered_map> |
| 12 | 12 |
| 13 #include "content/public/browser/render_process_host_observer.h" | 13 #include "content/public/browser/render_process_host_observer.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "headless/public/headless_devtools_target.h" | 15 #include "headless/public/headless_devtools_target.h" |
| 16 #include "headless/public/headless_export.h" | |
| 16 #include "headless/public/headless_web_contents.h" | 17 #include "headless/public/headless_web_contents.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 class DevToolsAgentHost; | 20 class DevToolsAgentHost; |
| 20 class WebContents; | 21 class WebContents; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gfx { | 24 namespace gfx { |
| 24 class Size; | 25 class Size; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace headless { | 28 namespace headless { |
| 28 class HeadlessBrowserImpl; | 29 class HeadlessBrowserImpl; |
| 29 class WebContentsObserverAdapter; | 30 class WebContentsObserverAdapter; |
| 30 | 31 |
| 31 class HeadlessWebContentsImpl : public HeadlessWebContents, | 32 class HEADLESS_EXPORT HeadlessWebContentsImpl |
|
Sami
2017/03/24 10:28:40
Ditto.
dvallet
2017/03/27 02:44:01
Done.
| |
| 32 public HeadlessDevToolsTarget, | 33 : public HeadlessWebContents, |
| 33 public content::RenderProcessHostObserver, | 34 public HeadlessDevToolsTarget, |
| 34 public content::WebContentsObserver { | 35 public content::RenderProcessHostObserver, |
| 36 public content::WebContentsObserver { | |
| 35 public: | 37 public: |
| 36 ~HeadlessWebContentsImpl() override; | 38 ~HeadlessWebContentsImpl() override; |
| 37 | 39 |
| 38 static HeadlessWebContentsImpl* From(HeadlessWebContents* web_contents); | 40 static HeadlessWebContentsImpl* From(HeadlessWebContents* web_contents); |
| 39 | 41 |
| 40 static std::unique_ptr<HeadlessWebContentsImpl> Create( | 42 static std::unique_ptr<HeadlessWebContentsImpl> Create( |
| 41 HeadlessWebContents::Builder* builder); | 43 HeadlessWebContents::Builder* builder); |
| 42 | 44 |
| 43 // Takes ownership of |web_contents|. | 45 // Takes ownership of |web_contents|. |
| 44 static std::unique_ptr<HeadlessWebContentsImpl> CreateFromWebContents( | 46 static std::unique_ptr<HeadlessWebContentsImpl> CreateFromWebContents( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 std::unordered_map<HeadlessWebContents::Observer*, | 99 std::unordered_map<HeadlessWebContents::Observer*, |
| 98 std::unique_ptr<WebContentsObserverAdapter>>; | 100 std::unique_ptr<WebContentsObserverAdapter>>; |
| 99 ObserverMap observer_map_; | 101 ObserverMap observer_map_; |
| 100 | 102 |
| 101 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl); | 103 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 } // namespace headless | 106 } // namespace headless |
| 105 | 107 |
| 106 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ | 108 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |