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

Side by Side Diff: components/html_viewer/html_frame.h

Issue 1340983002: Mandoline UI Process: Update namespaces and file names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated all the namespaces in mus Created 5 years, 3 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 COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_FRAME_H_
6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ 6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 namespace blink { 28 namespace blink {
29 class WebFrame; 29 class WebFrame;
30 class WebWidget; 30 class WebWidget;
31 } 31 }
32 32
33 namespace mojo { 33 namespace mojo {
34 class ApplicationImpl; 34 class ApplicationImpl;
35 class Rect; 35 class Rect;
36 }
37
38 namespace mus {
36 class ScopedViewPtr; 39 class ScopedViewPtr;
37 class View; 40 class View;
38 } 41 }
39 42
40 namespace html_viewer { 43 namespace html_viewer {
41 44
42 class DevToolsAgentImpl; 45 class DevToolsAgentImpl;
43 class GeolocationClientImpl; 46 class GeolocationClientImpl;
44 class HTMLFrameDelegate; 47 class HTMLFrameDelegate;
45 class HTMLFrameTreeManager; 48 class HTMLFrameTreeManager;
46 class HTMLWidget; 49 class HTMLWidget;
47 class TouchHandler; 50 class TouchHandler;
48 class WebLayerTreeViewImpl; 51 class WebLayerTreeViewImpl;
49 52
50 // Frame is used to represent a single frame in the frame tree of a page. The 53 // Frame is used to represent a single frame in the frame tree of a page. The
51 // frame is either local or remote. Each Frame is associated with a single 54 // frame is either local or remote. Each Frame is associated with a single
52 // HTMLFrameTreeManager and can not be moved to another HTMLFrameTreeManager. 55 // HTMLFrameTreeManager and can not be moved to another HTMLFrameTreeManager.
53 // Local frames have a mojo::View, remote frames do not. 56 // Local frames have a mus::View, remote frames do not.
54 // 57 //
55 // HTMLFrame serves as the FrameTreeClient. It implements it by forwarding 58 // HTMLFrame serves as the FrameTreeClient. It implements it by forwarding
56 // the calls to HTMLFrameTreeManager so that HTMLFrameTreeManager can update 59 // the calls to HTMLFrameTreeManager so that HTMLFrameTreeManager can update
57 // the frame tree as appropriate. 60 // the frame tree as appropriate.
58 // 61 //
59 // Local frames may share the connection (and client implementation) with an 62 // Local frames may share the connection (and client implementation) with an
60 // ancestor. This happens when a child frame is created. Once a navigate 63 // ancestor. This happens when a child frame is created. Once a navigate
61 // happens the frame is swapped to a remote frame. 64 // happens the frame is swapped to a remote frame.
62 // 65 //
63 // Remote frames may become local again if the embed happens in the same 66 // Remote frames may become local again if the embed happens in the same
64 // process. See HTMLFrameTreeManager for details. 67 // process. See HTMLFrameTreeManager for details.
65 class HTMLFrame : public blink::WebFrameClient, 68 class HTMLFrame : public blink::WebFrameClient,
66 public blink::WebRemoteFrameClient, 69 public blink::WebRemoteFrameClient,
67 public web_view::FrameTreeClient, 70 public web_view::FrameTreeClient,
68 public mojo::ViewObserver { 71 public mus::ViewObserver {
69 public: 72 public:
70 struct CreateParams { 73 struct CreateParams {
71 CreateParams( 74 CreateParams(
72 HTMLFrameTreeManager* manager, 75 HTMLFrameTreeManager* manager,
73 HTMLFrame* parent, 76 HTMLFrame* parent,
74 uint32_t id, 77 uint32_t id,
75 mojo::View* view, 78 mus::View* view,
76 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties, 79 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties,
77 HTMLFrameDelegate* delegate) 80 HTMLFrameDelegate* delegate)
78 : manager(manager), 81 : manager(manager),
79 parent(parent), 82 parent(parent),
80 id(id), 83 id(id),
81 view(view), 84 view(view),
82 properties(properties), 85 properties(properties),
83 delegate(delegate), 86 delegate(delegate),
84 allow_local_shared_frame(false) {} 87 allow_local_shared_frame(false) {}
85 ~CreateParams() {} 88 ~CreateParams() {}
86 89
87 HTMLFrameTreeManager* manager; 90 HTMLFrameTreeManager* manager;
88 HTMLFrame* parent; 91 HTMLFrame* parent;
89 uint32_t id; 92 uint32_t id;
90 mojo::View* view; 93 mus::View* view;
91 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties; 94 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties;
92 HTMLFrameDelegate* delegate; 95 HTMLFrameDelegate* delegate;
93 96
94 private: 97 private:
95 friend class HTMLFrame; 98 friend class HTMLFrame;
96 99
97 // TODO(sky): nuke. 100 // TODO(sky): nuke.
98 bool allow_local_shared_frame; 101 bool allow_local_shared_frame;
99 }; 102 };
100 103
(...skipping 17 matching lines...) Expand all
118 121
119 // Returns the WebFrame for this Frame. This is either a WebLocalFrame or 122 // Returns the WebFrame for this Frame. This is either a WebLocalFrame or
120 // WebRemoteFrame. 123 // WebRemoteFrame.
121 blink::WebFrame* web_frame() { return web_frame_; } 124 blink::WebFrame* web_frame() { return web_frame_; }
122 125
123 // Returns the WebView for this frame, or null if there isn't one. The root 126 // Returns the WebView for this frame, or null if there isn't one. The root
124 // has a WebView, the children WebFrameWidgets. 127 // has a WebView, the children WebFrameWidgets.
125 blink::WebView* web_view(); 128 blink::WebView* web_view();
126 blink::WebWidget* GetWebWidget(); 129 blink::WebWidget* GetWebWidget();
127 130
128 // The mojo::View this frame renders to. This is non-null for the local frame 131 // The mus::View this frame renders to. This is non-null for the local frame
129 // the frame tree was created with as well as non-null for any frames created 132 // the frame tree was created with as well as non-null for any frames created
130 // locally. 133 // locally.
131 mojo::View* view() { return view_; } 134 mus::View* view() { return view_; }
132 135
133 HTMLFrameTreeManager* frame_tree_manager() { return frame_tree_manager_; } 136 HTMLFrameTreeManager* frame_tree_manager() { return frame_tree_manager_; }
134 137
135 // Returns null if the browser side didn't request to setup an agent in this 138 // Returns null if the browser side didn't request to setup an agent in this
136 // frame. 139 // frame.
137 DevToolsAgentImpl* devtools_agent() { return devtools_agent_.get(); } 140 DevToolsAgentImpl* devtools_agent() { return devtools_agent_.get(); }
138 141
139 // Returns true if the Frame is local, false if remote. 142 // Returns true if the Frame is local, false if remote.
140 bool IsLocal() const; 143 bool IsLocal() const;
141 144
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // The local root is the first ancestor (starting at this) that has its own 207 // The local root is the first ancestor (starting at this) that has its own
205 // connection. 208 // connection.
206 HTMLFrame* GetLocalRoot(); 209 HTMLFrame* GetLocalRoot();
207 210
208 // Returns the ApplicationImpl from the local root's delegate. 211 // Returns the ApplicationImpl from the local root's delegate.
209 mojo::ApplicationImpl* GetLocalRootApp(); 212 mojo::ApplicationImpl* GetLocalRootApp();
210 213
211 // Gets the FrameTreeServer to use for this frame. 214 // Gets the FrameTreeServer to use for this frame.
212 web_view::FrameTreeServer* GetFrameTreeServer(); 215 web_view::FrameTreeServer* GetFrameTreeServer();
213 216
214 void SetView(mojo::View* view); 217 void SetView(mus::View* view);
215 218
216 // Creates the appropriate WebWidget implementation for the Frame. 219 // Creates the appropriate WebWidget implementation for the Frame.
217 void CreateRootWebWidget(); 220 void CreateRootWebWidget();
218 void CreateLocalRootWebWidget(blink::WebLocalFrame* local_frame); 221 void CreateLocalRootWebWidget(blink::WebLocalFrame* local_frame);
219 222
220 void UpdateFocus(); 223 void UpdateFocus();
221 224
222 // Swaps this frame from a local frame to remote frame. |request| is the url 225 // Swaps this frame from a local frame to remote frame. |request| is the url
223 // to load in the frame. 226 // to load in the frame.
224 void SwapToRemote(); 227 void SwapToRemote();
225 228
226 // Swaps this frame from a remote frame to a local frame. 229 // Swaps this frame from a remote frame to a local frame.
227 void SwapToLocal( 230 void SwapToLocal(
228 HTMLFrameDelegate* delegate, 231 HTMLFrameDelegate* delegate,
229 mojo::View* view, 232 mus::View* view,
230 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); 233 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties);
231 234
232 // Invoked when changing the delegate. This informs the new delegate to take 235 // Invoked when changing the delegate. This informs the new delegate to take
233 // over. This is used when a different connection is going to take over 236 // over. This is used when a different connection is going to take over
234 // responsibility for the frame. 237 // responsibility for the frame.
235 void SwapDelegate(HTMLFrameDelegate* delegate); 238 void SwapDelegate(HTMLFrameDelegate* delegate);
236 239
237 GlobalState* global_state() { return frame_tree_manager_->global_state(); } 240 GlobalState* global_state() { return frame_tree_manager_->global_state(); }
238 241
239 // Returns the Frame associated with the specified WebFrame. 242 // Returns the Frame associated with the specified WebFrame.
240 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); 243 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame);
241 244
242 // The various frameDetached() implementations call into this. 245 // The various frameDetached() implementations call into this.
243 void FrameDetachedImpl(blink::WebFrame* web_frame); 246 void FrameDetachedImpl(blink::WebFrame* web_frame);
244 247
245 // mojo::ViewObserver methods: 248 // mus::ViewObserver methods:
246 void OnViewBoundsChanged(mojo::View* view, 249 void OnViewBoundsChanged(mus::View* view,
247 const mojo::Rect& old_bounds, 250 const mojo::Rect& old_bounds,
248 const mojo::Rect& new_bounds) override; 251 const mojo::Rect& new_bounds) override;
249 void OnViewDestroyed(mojo::View* view) override; 252 void OnViewDestroyed(mus::View* view) override;
250 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override; 253 void OnViewInputEvent(mus::View* view, const mojo::EventPtr& event) override;
251 void OnViewFocusChanged(mojo::View* gained_focus, 254 void OnViewFocusChanged(mus::View* gained_focus,
252 mojo::View* lost_focus) override; 255 mus::View* lost_focus) override;
253 256
254 // web_view::FrameTreeClient: 257 // web_view::FrameTreeClient:
255 void OnConnect(web_view::FrameTreeServerPtr server, 258 void OnConnect(web_view::FrameTreeServerPtr server,
256 uint32_t change_id, 259 uint32_t change_id,
257 uint32_t view_id, 260 uint32_t view_id,
258 web_view::ViewConnectType view_connect_type, 261 web_view::ViewConnectType view_connect_type,
259 mojo::Array<web_view::FrameDataPtr> frame_data, 262 mojo::Array<web_view::FrameDataPtr> frame_data,
260 const OnConnectCallback& callback) override; 263 const OnConnectCallback& callback) override;
261 void OnFrameAdded(uint32_t change_id, 264 void OnFrameAdded(uint32_t change_id,
262 web_view::FrameDataPtr frame_data) override; 265 web_view::FrameDataPtr frame_data) override;
(...skipping 17 matching lines...) Expand all
280 float scale_factor); 283 float scale_factor);
281 virtual void navigate(const blink::WebURLRequest& request, 284 virtual void navigate(const blink::WebURLRequest& request,
282 bool should_replace_current_entry); 285 bool should_replace_current_entry);
283 virtual void reload(bool ignore_cache, bool is_client_redirect); 286 virtual void reload(bool ignore_cache, bool is_client_redirect);
284 virtual void forwardInputEvent(const blink::WebInputEvent* event); 287 virtual void forwardInputEvent(const blink::WebInputEvent* event);
285 288
286 HTMLFrameTreeManager* frame_tree_manager_; 289 HTMLFrameTreeManager* frame_tree_manager_;
287 HTMLFrame* parent_; 290 HTMLFrame* parent_;
288 // |view_| is non-null for local frames or remote frames that were once 291 // |view_| is non-null for local frames or remote frames that were once
289 // local. 292 // local.
290 mojo::View* view_; 293 mus::View* view_;
291 // The id for this frame. If there is a view, this is the same id as the 294 // The id for this frame. If there is a view, this is the same id as the
292 // view has. 295 // view has.
293 const uint32_t id_; 296 const uint32_t id_;
294 std::vector<HTMLFrame*> children_; 297 std::vector<HTMLFrame*> children_;
295 blink::WebFrame* web_frame_; 298 blink::WebFrame* web_frame_;
296 scoped_ptr<HTMLWidget> html_widget_; 299 scoped_ptr<HTMLWidget> html_widget_;
297 scoped_ptr<GeolocationClientImpl> geolocation_client_impl_; 300 scoped_ptr<GeolocationClientImpl> geolocation_client_impl_;
298 scoped_ptr<TouchHandler> touch_handler_; 301 scoped_ptr<TouchHandler> touch_handler_;
299 302
300 scoped_ptr<cc_blink::WebLayerImpl> web_layer_; 303 scoped_ptr<cc_blink::WebLayerImpl> web_layer_;
301 304
302 HTMLFrameDelegate* delegate_; 305 HTMLFrameDelegate* delegate_;
303 scoped_ptr<mojo::Binding<web_view::FrameTreeClient>> 306 scoped_ptr<mojo::Binding<web_view::FrameTreeClient>>
304 frame_tree_client_binding_; 307 frame_tree_client_binding_;
305 web_view::FrameTreeServerPtr server_; 308 web_view::FrameTreeServerPtr server_;
306 309
307 ReplicatedFrameState state_; 310 ReplicatedFrameState state_;
308 311
309 // If this frame is the result of creating a local frame 312 // If this frame is the result of creating a local frame
310 // (createChildFrame()), then |owned_view_| is the View initially created 313 // (createChildFrame()), then |owned_view_| is the View initially created
311 // for the frame. While the frame is local |owned_view_| is the same as 314 // for the frame. While the frame is local |owned_view_| is the same as
312 // |view_|. If this frame becomes remote |view_| is set to null and 315 // |view_|. If this frame becomes remote |view_| is set to null and
313 // |owned_view_| remains as the View initially created for the frame. 316 // |owned_view_| remains as the View initially created for the frame.
314 // 317 //
315 // This is done to ensure the View isn't prematurely deleted (it must exist 318 // This is done to ensure the View isn't prematurely deleted (it must exist
316 // as long as the frame is valid). If the View was deleted as soon as the 319 // as long as the frame is valid). If the View was deleted as soon as the
317 // frame was swapped to remote then the process rendering to the view would 320 // frame was swapped to remote then the process rendering to the view would
318 // be severed. 321 // be severed.
319 scoped_ptr<mojo::ScopedViewPtr> owned_view_; 322 scoped_ptr<mus::ScopedViewPtr> owned_view_;
320 323
321 // This object is only valid in the context of performance tests. 324 // This object is only valid in the context of performance tests.
322 tracing::StartupPerformanceDataCollectorPtr 325 tracing::StartupPerformanceDataCollectorPtr
323 startup_performance_data_collector_; 326 startup_performance_data_collector_;
324 327
325 scoped_ptr<DevToolsAgentImpl> devtools_agent_; 328 scoped_ptr<DevToolsAgentImpl> devtools_agent_;
326 329
327 base::WeakPtrFactory<HTMLFrame> weak_factory_; 330 base::WeakPtrFactory<HTMLFrame> weak_factory_;
328 331
329 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); 332 DISALLOW_COPY_AND_ASSIGN(HTMLFrame);
330 }; 333 };
331 334
332 } // namespace html_viewer 335 } // namespace html_viewer
333 336
334 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ 337 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698