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: components/web_view/web_view_impl.h

Issue 1326443006: mandoline: Add back/forward support and UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add apptests. 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_WEB_VIEW_WEB_VIEW_IMPL_H_ 5 #ifndef COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
6 #define COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_ 6 #define COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
10 #include "components/view_manager/public/cpp/view_observer.h" 11 #include "components/view_manager/public/cpp/view_observer.h"
11 #include "components/view_manager/public/cpp/view_tree_delegate.h" 12 #include "components/view_manager/public/cpp/view_tree_delegate.h"
12 #include "components/web_view/frame_devtools_agent_delegate.h" 13 #include "components/web_view/frame_devtools_agent_delegate.h"
13 #include "components/web_view/frame_tree_delegate.h" 14 #include "components/web_view/frame_tree_delegate.h"
14 #include "components/web_view/public/interfaces/web_view.mojom.h" 15 #include "components/web_view/public/interfaces/web_view.mojom.h"
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
16 17
17 namespace mojo { 18 namespace mojo {
18 class ApplicationImpl; 19 class ApplicationImpl;
19 } 20 }
20 21
21 namespace web_view { 22 namespace web_view {
22 23
23 class Frame; 24 class Frame;
25 class FrameDevToolsAgent;
24 class FrameTree; 26 class FrameTree;
25 class FrameDevToolsAgent;
26 class HTMLMessageEvent; 27 class HTMLMessageEvent;
27 class PendingWebViewLoad; 28 class PendingWebViewLoad;
29 class URLRequestCloneable;
28 30
29 class WebViewImpl : public mojom::WebView, 31 class WebViewImpl : public mojom::WebView,
30 public mojo::ViewTreeDelegate, 32 public mojo::ViewTreeDelegate,
31 public mojo::ViewObserver, 33 public mojo::ViewObserver,
32 public FrameTreeDelegate, 34 public FrameTreeDelegate,
33 public FrameDevToolsAgentDelegate { 35 public FrameDevToolsAgentDelegate {
34 public: 36 public:
35 WebViewImpl(mojo::ApplicationImpl* app, 37 WebViewImpl(mojo::ApplicationImpl* app,
36 mojom::WebViewClientPtr client, 38 mojom::WebViewClientPtr client,
37 mojo::InterfaceRequest<WebView> request); 39 mojo::InterfaceRequest<WebView> request);
38 ~WebViewImpl() override; 40 ~WebViewImpl() override;
39 41
40 private: 42 private:
41 friend class PendingWebViewLoad; 43 friend class PendingWebViewLoad;
42 44
43 // See description above |pending_load_| for details. 45 // See description above |pending_load_| for details.
44 void OnLoad(); 46 void OnLoad();
45 47
48 // Actually performs the load, and tells our delegate what the state of the
msw 2015/09/11 20:07:54 nit: no comma and "tells our delegate the state of
49 // forward/back list is. This is the shared implementation between
50 // LoadRequest() and Go{Back,Forward}().
51 void LoadRequestImpl(mojo::URLRequestPtr request);
52
46 // Overridden from WebView: 53 // Overridden from WebView:
47 void LoadRequest(mojo::URLRequestPtr request) override; 54 void LoadRequest(mojo::URLRequestPtr request) override;
48 void GetViewTreeClient( 55 void GetViewTreeClient(
49 mojo::InterfaceRequest<mojo::ViewTreeClient> view_tree_client) 56 mojo::InterfaceRequest<mojo::ViewTreeClient> view_tree_client)
50 override; 57 override;
58 void GoBack() override;
59 void GoForward() override;
51 60
52 // Overridden from mojo::ViewTreeDelegate: 61 // Overridden from mojo::ViewTreeDelegate:
53 void OnEmbed(mojo::View* root) override; 62 void OnEmbed(mojo::View* root) override;
54 void OnConnectionLost(mojo::ViewTreeConnection* connection) override; 63 void OnConnectionLost(mojo::ViewTreeConnection* connection) override;
55 64
56 // Overridden from mojo::ViewObserver: 65 // Overridden from mojo::ViewObserver:
57 void OnViewBoundsChanged(mojo::View* view, 66 void OnViewBoundsChanged(mojo::View* view,
58 const mojo::Rect& old_bounds, 67 const mojo::Rect& old_bounds,
59 const mojo::Rect& new_bounds) override; 68 const mojo::Rect& new_bounds) override;
60 void OnViewDestroyed(mojo::View* view) override; 69 void OnViewDestroyed(mojo::View* view) override;
(...skipping 21 matching lines...) Expand all
82 mojo::View* content_; 91 mojo::View* content_;
83 scoped_ptr<FrameTree> frame_tree_; 92 scoped_ptr<FrameTree> frame_tree_;
84 93
85 // When LoadRequest() is called a PendingWebViewLoad is created to wait for 94 // When LoadRequest() is called a PendingWebViewLoad is created to wait for
86 // state needed to process the request. When the state is obtained OnLoad() 95 // state needed to process the request. When the state is obtained OnLoad()
87 // is invoked. 96 // is invoked.
88 scoped_ptr<PendingWebViewLoad> pending_load_; 97 scoped_ptr<PendingWebViewLoad> pending_load_;
89 98
90 scoped_ptr<FrameDevToolsAgent> devtools_agent_; 99 scoped_ptr<FrameDevToolsAgent> devtools_agent_;
91 100
101 // It would be nice if mojo::URLRequest were cloneable; however, its use of
102 // ScopedDataPipieConsumerHandle means that it isn't.
103 ScopedVector<URLRequestCloneable> back_list_;
104 ScopedVector<URLRequestCloneable> forward_list_;
105
106 // The request which is either currently loading or completed. Added to
107 // |back_list_| or |forward_list_| on further navigation.
108 scoped_ptr<URLRequestCloneable> current_page_request_;
109
92 DISALLOW_COPY_AND_ASSIGN(WebViewImpl); 110 DISALLOW_COPY_AND_ASSIGN(WebViewImpl);
93 }; 111 };
94 112
95 } // namespace web_view 113 } // namespace web_view
96 114
97 #endif // COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_ 115 #endif // COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698