OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_NAVIGATION_VIEW_IMPL_H_ | 5 #ifndef SERVICES_NAVIGATION_VIEW_IMPL_H_ |
6 #define SERVICES_NAVIGATION_VIEW_IMPL_H_ | 6 #define SERVICES_NAVIGATION_VIEW_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/mus/public/cpp/window_tree_delegate.h" | 9 #include "components/mus/public/cpp/window_tree_client_delegate.h" |
10 #include "content/public/browser/web_contents_delegate.h" | 10 #include "content/public/browser/web_contents_delegate.h" |
11 #include "mojo/public/cpp/bindings/binding_set.h" | 11 #include "mojo/public/cpp/bindings/binding_set.h" |
12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
13 #include "services/navigation/public/interfaces/view.mojom.h" | 13 #include "services/navigation/public/interfaces/view.mojom.h" |
14 #include "services/shell/public/cpp/interface_factory.h" | 14 #include "services/shell/public/cpp/interface_factory.h" |
15 #include "services/shell/public/cpp/shell_client.h" | 15 #include "services/shell/public/cpp/shell_client.h" |
16 #include "services/shell/public/cpp/shell_connection_ref.h" | 16 #include "services/shell/public/cpp/shell_connection_ref.h" |
17 #include "ui/views/widget/widget_delegate.h" | 17 #include "ui/views/widget/widget_delegate.h" |
18 | 18 |
19 namespace views { | 19 namespace views { |
20 class WebView; | 20 class WebView; |
21 class Widget; | 21 class Widget; |
22 } | 22 } |
23 | 23 |
24 namespace navigation { | 24 namespace navigation { |
25 | 25 |
26 class ViewImpl : public mojom::View, | 26 class ViewImpl : public mojom::View, |
27 public content::WebContentsDelegate, | 27 public content::WebContentsDelegate, |
28 public mus::WindowTreeDelegate, | 28 public mus::WindowTreeClientDelegate, |
29 public views::WidgetDelegate { | 29 public views::WidgetDelegate { |
30 public: | 30 public: |
31 ViewImpl(shell::Connector* connector, | 31 ViewImpl(shell::Connector* connector, |
32 content::BrowserContext* browser_context, | 32 content::BrowserContext* browser_context, |
33 mojom::ViewClientPtr client, | 33 mojom::ViewClientPtr client, |
34 mojom::ViewRequest request, | 34 mojom::ViewRequest request, |
35 std::unique_ptr<shell::ShellConnectionRef> ref); | 35 std::unique_ptr<shell::ShellConnectionRef> ref); |
36 ~ViewImpl() override; | 36 ~ViewImpl() override; |
37 | 37 |
38 private: | 38 private: |
(...skipping 14 matching lines...) Expand all Loading... |
53 bool user_gesture, | 53 bool user_gesture, |
54 bool* was_blocked) override; | 54 bool* was_blocked) override; |
55 void CloseContents(content::WebContents* source) override; | 55 void CloseContents(content::WebContents* source) override; |
56 void LoadingStateChanged(content::WebContents* source, | 56 void LoadingStateChanged(content::WebContents* source, |
57 bool to_different_document) override; | 57 bool to_different_document) override; |
58 void NavigationStateChanged(content::WebContents* source, | 58 void NavigationStateChanged(content::WebContents* source, |
59 content::InvalidateTypes changed_flags) override; | 59 content::InvalidateTypes changed_flags) override; |
60 void LoadProgressChanged(content::WebContents* source, | 60 void LoadProgressChanged(content::WebContents* source, |
61 double progress) override; | 61 double progress) override; |
62 | 62 |
63 // mus::WindowTreeDelegate: | 63 // mus::WindowTreeClientDelegate: |
64 void OnEmbed(mus::Window* root) override; | 64 void OnEmbed(mus::Window* root) override; |
65 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 65 void OnWindowTreeClientDestroyed(mus::WindowTreeClient* client) override; |
66 void OnEventObserved(const ui::Event& event, mus::Window* target) override; | 66 void OnEventObserved(const ui::Event& event, mus::Window* target) override; |
67 | 67 |
68 // views::WidgetDelegate: | 68 // views::WidgetDelegate: |
69 views::View* GetContentsView() override; | 69 views::View* GetContentsView() override; |
70 views::Widget* GetWidget() override; | 70 views::Widget* GetWidget() override; |
71 const views::Widget* GetWidget() const override; | 71 const views::Widget* GetWidget() const override; |
72 | 72 |
73 shell::Connector* connector_; | 73 shell::Connector* connector_; |
74 mojo::StrongBinding<mojom::View> binding_; | 74 mojo::StrongBinding<mojom::View> binding_; |
75 mojom::ViewClientPtr client_; | 75 mojom::ViewClientPtr client_; |
76 std::unique_ptr<shell::ShellConnectionRef> ref_; | 76 std::unique_ptr<shell::ShellConnectionRef> ref_; |
77 | 77 |
78 views::WebView* web_view_; | 78 views::WebView* web_view_; |
79 | 79 |
80 std::unique_ptr<content::WebContents> web_contents_; | 80 std::unique_ptr<content::WebContents> web_contents_; |
81 | 81 |
82 std::unique_ptr<views::Widget> widget_; | 82 std::unique_ptr<views::Widget> widget_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(ViewImpl); | 84 DISALLOW_COPY_AND_ASSIGN(ViewImpl); |
85 }; | 85 }; |
86 | 86 |
87 } // navigation | 87 } // navigation |
88 | 88 |
89 #endif // SERVICES_NAVIGATION_VIEW_IMPL_H_ | 89 #endif // SERVICES_NAVIGATION_VIEW_IMPL_H_ |
OLD | NEW |