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

Side by Side Diff: components/web_view/web_view_impl.h

Issue 1677293002: Bye bye Mandoline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 years, 10 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 | « components/web_view/web_view_apptest.cc ('k') | components/web_view/web_view_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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
6 #define COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
7
8 #include <stdint.h>
9
10 #include <deque>
11 #include <string>
12
13 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "components/mus/public/cpp/window_observer.h"
16 #include "components/mus/public/cpp/window_tree_delegate.h"
17 #include "components/web_view/find_controller.h"
18 #include "components/web_view/find_controller_delegate.h"
19 #include "components/web_view/frame_devtools_agent_delegate.h"
20 #include "components/web_view/frame_tree_delegate.h"
21 #include "components/web_view/navigation_controller.h"
22 #include "components/web_view/navigation_controller_delegate.h"
23 #include "components/web_view/public/interfaces/frame.mojom.h"
24 #include "components/web_view/public/interfaces/web_view.mojom.h"
25 #include "mojo/public/cpp/bindings/strong_binding.h"
26
27 namespace mojo {
28 class Shell;
29 }
30
31 namespace web_view {
32
33 class Frame;
34 class FrameDevToolsAgent;
35 class FrameTree;
36 class PendingWebViewLoad;
37 class URLRequestCloneable;
38
39 namespace mojom {
40 class HTMLMessageEvent;
41 }
42
43 class WebViewImpl : public mojom::WebView,
44 public mus::WindowTreeDelegate,
45 public mus::WindowObserver,
46 public FrameTreeDelegate,
47 public FrameDevToolsAgentDelegate,
48 public NavigationControllerDelegate,
49 public FindControllerDelegate {
50 public:
51 WebViewImpl(mojo::Shell* shell,
52 mojom::WebViewClientPtr client,
53 mojo::InterfaceRequest<WebView> request);
54 ~WebViewImpl() override;
55
56 private:
57 friend class PendingWebViewLoad;
58
59 // See description above |pending_load_| for details.
60 void OnLoad(const GURL& pending_url);
61
62 // Flatten the frame tree in pre-order, depth first.
63 void PreOrderDepthFirstTraverseTree(Frame* node, std::vector<Frame*>* output);
64
65 // Overridden from WebView:
66 void LoadRequest(mojo::URLRequestPtr request) override;
67 void GetWindowTreeClient(mojo::InterfaceRequest<mus::mojom::WindowTreeClient>
68 window_tree_client) override;
69 void Find(const mojo::String& search_text, bool forward_direction) override;
70 void StopFinding() override;
71 void GoBack() override;
72 void GoForward() override;
73
74 // Overridden from mus::WindowTreeDelegate:
75 void OnEmbed(mus::Window* root) override;
76 void OnConnectionLost(mus::WindowTreeConnection* connection) override;
77
78 // Overridden from mus::WindowObserver:
79 void OnWindowBoundsChanged(mus::Window* window,
80 const gfx::Rect& old_bounds,
81 const gfx::Rect& new_bounds) override;
82 void OnWindowDestroyed(mus::Window* window) override;
83
84 // Overridden from FrameTreeDelegate:
85 scoped_ptr<FrameUserData> CreateUserDataForNewFrame(
86 mojom::FrameClientPtr frame_client) override;
87 bool CanPostMessageEventToFrame(const Frame* source,
88 const Frame* target,
89 mojom::HTMLMessageEvent* event) override;
90 void LoadingStateChanged(bool loading, double progress) override;
91 void TitleChanged(const mojo::String& title) override;
92 void NavigateTopLevel(Frame* source, mojo::URLRequestPtr request) override;
93 void CanNavigateFrame(Frame* target,
94 mojo::URLRequestPtr request,
95 const CanNavigateFrameCallback& callback) override;
96 void DidStartNavigation(Frame* frame) override;
97 void DidCommitProvisionalLoad(Frame* frame) override;
98 void DidNavigateLocally(Frame* source, const GURL& url) override;
99 void DidDestroyFrame(Frame* frame) override;
100 void OnFindInFrameCountUpdated(int32_t request_id,
101 Frame* frame,
102 int32_t count,
103 bool final_update) override;
104 void OnFindInPageSelectionUpdated(int32_t request_id,
105 Frame* frame,
106 int32_t active_match_ordinal) override;
107
108 // Overridden from FrameDevToolsAgent::Delegate:
109 void HandlePageNavigateRequest(const GURL& url) override;
110
111 // Overridden from NavigationControllerDelegate:
112 void OnNavigate(mojo::URLRequestPtr request) override;
113 void OnDidNavigate() override;
114
115 // Overridden from FindControllerDelegate:
116 std::vector<Frame*> GetAllFrames() override;
117 mojom::WebViewClient* GetWebViewClient() override;
118
119 mojo::Shell* shell_;
120 mojom::WebViewClientPtr client_;
121 mojo::StrongBinding<WebView> binding_;
122 mus::Window* root_;
123 mus::Window* content_;
124 // |find_controller_| is referenced by frame_tree_'s frames at destruction.
125 FindController find_controller_;
126 scoped_ptr<FrameTree> frame_tree_;
127
128 // When LoadRequest() is called a PendingWebViewLoad is created to wait for
129 // state needed to process the request. When the state is obtained OnLoad()
130 // is invoked.
131 scoped_ptr<PendingWebViewLoad> pending_load_;
132
133 scoped_ptr<FrameDevToolsAgent> devtools_agent_;
134
135 NavigationController navigation_controller_;
136
137 DISALLOW_COPY_AND_ASSIGN(WebViewImpl);
138 };
139
140 } // namespace web_view
141
142 #endif // COMPONENTS_WEB_VIEW_WEB_VIEW_IMPL_H_
OLDNEW
« no previous file with comments | « components/web_view/web_view_apptest.cc ('k') | components/web_view/web_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698