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

Side by Side Diff: headless/public/headless_web_contents.h

Issue 2226323002: Resize DevTools target frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename, add tests, fix comments/style, add support in shell. Created 4 years, 4 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
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_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 5 #ifndef HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "headless/public/headless_export.h" 14 #include "headless/public/headless_export.h"
15 #include "mojo/public/cpp/bindings/interface_request.h" 15 #include "mojo/public/cpp/bindings/interface_request.h"
16 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
17 #include "url/gurl.h" 17 #include "url/gurl.h"
18 18
19 namespace content {
20 class WebContents;
21 }
22
19 namespace headless { 23 namespace headless {
20 class HeadlessBrowserContextImpl; 24 class HeadlessBrowserContextImpl;
21 class HeadlessBrowserImpl; 25 class HeadlessBrowserImpl;
22 class HeadlessDevToolsTarget; 26 class HeadlessDevToolsTarget;
23 27
24 // Class representing contents of a browser tab. Should be accessed from browser 28 // Class representing contents of a browser tab. Should be accessed from browser
25 // main thread. 29 // main thread.
26 class HEADLESS_EXPORT HeadlessWebContents { 30 class HEADLESS_EXPORT HeadlessWebContents {
27 public: 31 public:
28 class Builder; 32 class Builder;
(...skipping 21 matching lines...) Expand all
50 // Add or remove an observer to receive events from this WebContents. 54 // Add or remove an observer to receive events from this WebContents.
51 // |observer| must outlive this class or be removed prior to being destroyed. 55 // |observer| must outlive this class or be removed prior to being destroyed.
52 virtual void AddObserver(Observer* observer) = 0; 56 virtual void AddObserver(Observer* observer) = 0;
53 virtual void RemoveObserver(Observer* observer) = 0; 57 virtual void RemoveObserver(Observer* observer) = 0;
54 58
55 // Return a DevTools target corresponding to this tab. Note that this method 59 // Return a DevTools target corresponding to this tab. Note that this method
56 // won't return a valid value until Observer::DevToolsTargetReady has been 60 // won't return a valid value until Observer::DevToolsTargetReady has been
57 // signaled. 61 // signaled.
58 virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0; 62 virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0;
59 63
64 // Return a pointer to the underlying content::WebContents.
65 virtual content::WebContents* GetWebContents() const = 0;
Sami 2016/08/10 12:11:40 Can we avoid exposing this? We don't want people a
Eric Seckler 2016/08/10 12:33:33 Done.
66
60 // Close this page. |HeadlessWebContents| object will be destroyed. 67 // Close this page. |HeadlessWebContents| object will be destroyed.
61 virtual void Close() = 0; 68 virtual void Close() = 0;
62 69
63 private: 70 private:
64 friend class HeadlessWebContentsImpl; 71 friend class HeadlessWebContentsImpl;
65 HeadlessWebContents() {} 72 HeadlessWebContents() {}
66 73
67 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents); 74 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents);
68 }; 75 };
69 76
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 GURL initial_url_ = GURL("about:blank"); 142 GURL initial_url_ = GURL("about:blank");
136 gfx::Size window_size_; 143 gfx::Size window_size_;
137 std::list<MojoService> mojo_services_; 144 std::list<MojoService> mojo_services_;
138 145
139 DISALLOW_COPY_AND_ASSIGN(Builder); 146 DISALLOW_COPY_AND_ASSIGN(Builder);
140 }; 147 };
141 148
142 } // namespace headless 149 } // namespace headless
143 150
144 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 151 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698