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

Side by Side Diff: headless/lib/browser/headless_browser_impl.h

Issue 2626823003: [headless] Add default browser context to HeadlessBrowser. (Closed)
Patch Set: More explicit error message. Created 3 years, 11 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
« no previous file with comments | « headless/app/headless_shell.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() 44 scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread()
45 const override; 45 const override;
46 46
47 void Shutdown() override; 47 void Shutdown() override;
48 48
49 std::vector<HeadlessBrowserContext*> GetAllBrowserContexts() override; 49 std::vector<HeadlessBrowserContext*> GetAllBrowserContexts() override;
50 HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( 50 HeadlessWebContents* GetWebContentsForDevToolsAgentHostId(
51 const std::string& devtools_agent_host_id) override; 51 const std::string& devtools_agent_host_id) override;
52 HeadlessBrowserContext* GetBrowserContextForId( 52 HeadlessBrowserContext* GetBrowserContextForId(
53 const std::string& id) override; 53 const std::string& id) override;
54 void SetDefaultBrowserContext(
55 HeadlessBrowserContext* browser_context) override;
56 HeadlessBrowserContext* GetDefaultBrowserContext() override;
54 57
55 void set_browser_main_parts(HeadlessBrowserMainParts* browser_main_parts); 58 void set_browser_main_parts(HeadlessBrowserMainParts* browser_main_parts);
56 HeadlessBrowserMainParts* browser_main_parts() const; 59 HeadlessBrowserMainParts* browser_main_parts() const;
57 60
58 void RunOnStartCallback(); 61 void RunOnStartCallback();
59 62
60 HeadlessBrowser::Options* options() { return &options_; } 63 HeadlessBrowser::Options* options() { return &options_; }
61 64
62 HeadlessBrowserContext* CreateBrowserContext( 65 HeadlessBrowserContext* CreateBrowserContext(
63 HeadlessBrowserContext::Builder* builder); 66 HeadlessBrowserContext::Builder* builder);
(...skipping 11 matching lines...) Expand all
75 HeadlessBrowserMainParts* browser_main_parts_; // Not owned. 78 HeadlessBrowserMainParts* browser_main_parts_; // Not owned.
76 79
77 // TODO(eseckler): Currently one window and one window_tree_host 80 // TODO(eseckler): Currently one window and one window_tree_host
78 // is used for all web contents. We should probably use one 81 // is used for all web contents. We should probably use one
79 // window per web contents, but additional investigation is needed. 82 // window per web contents, but additional investigation is needed.
80 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; 83 std::unique_ptr<aura::WindowTreeHost> window_tree_host_;
81 std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_; 84 std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
82 85
83 std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>> 86 std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>>
84 browser_contexts_; 87 browser_contexts_;
88 HeadlessBrowserContext* default_browser_context_; // Not owned.
85 89
86 base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_; 90 base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_;
87 91
88 private: 92 private:
89 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl); 93 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl);
90 }; 94 };
91 95
92 } // namespace headless 96 } // namespace headless
93 97
94 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 98 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
OLDNEW
« no previous file with comments | « headless/app/headless_shell.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698