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_BROWSER_IMPL_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ |
7 | 7 |
8 #include "headless/public/headless_browser.h" | 8 #include "headless/public/headless_browser.h" |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // (all web contents associated with it go away too). | 65 // (all web contents associated with it go away too). |
66 void DestroyBrowserContext(HeadlessBrowserContextImpl* browser_context); | 66 void DestroyBrowserContext(HeadlessBrowserContextImpl* browser_context); |
67 | 67 |
68 base::WeakPtr<HeadlessBrowserImpl> GetWeakPtr(); | 68 base::WeakPtr<HeadlessBrowserImpl> GetWeakPtr(); |
69 | 69 |
70 // All the methods that begin with Platform need to be implemented by the | 70 // All the methods that begin with Platform need to be implemented by the |
71 // platform specific headless implementation. | 71 // platform specific headless implementation. |
72 // Helper for one time initialization of application | 72 // Helper for one time initialization of application |
73 void PlatformInitialize(); | 73 void PlatformInitialize(); |
74 void PlatformCreateWindow(); | 74 void PlatformCreateWindow(); |
75 void PlatformSetWebContents(const gfx::Size& initial_size, | 75 void PlatformInitializeWebContents(const gfx::Size& initial_size, |
76 content::WebContents* web_contents); | 76 content::WebContents* web_contents); |
77 | 77 |
78 protected: | 78 protected: |
79 #if defined(USE_AURA) | 79 #if defined(USE_AURA) |
80 // TODO(eseckler): Currently one window and one window_tree_host | 80 // TODO(eseckler): Currently one window and one window_tree_host |
81 // is used for all web contents. We should probably use one | 81 // is used for all web contents. We should probably use one |
82 // window per web contents, but additional investigation is needed. | 82 // window per web contents, but additional investigation is needed. |
83 std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_; | 83 std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_; |
84 #endif | 84 #endif |
85 base::Callback<void(HeadlessBrowser*)> on_start_callback_; | 85 base::Callback<void(HeadlessBrowser*)> on_start_callback_; |
86 HeadlessBrowser::Options options_; | 86 HeadlessBrowser::Options options_; |
87 HeadlessBrowserMainParts* browser_main_parts_; // Not owned. | 87 HeadlessBrowserMainParts* browser_main_parts_; // Not owned. |
88 | 88 |
89 std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>> | 89 std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>> |
90 browser_contexts_; | 90 browser_contexts_; |
91 HeadlessBrowserContext* default_browser_context_; // Not owned. | 91 HeadlessBrowserContext* default_browser_context_; // Not owned. |
92 | 92 |
93 base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_; | 93 base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_; |
94 | 94 |
95 private: | 95 private: |
96 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl); | 96 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace headless | 99 } // namespace headless |
100 | 100 |
101 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ | 101 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ |
OLD | NEW |