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 "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
11 #include "content/public/browser/web_contents_delegate.h" | 11 #include "content/public/browser/web_contents_delegate.h" |
12 #include "mojo/public/cpp/bindings/binding_set.h" | 12 #include "mojo/public/cpp/bindings/binding_set.h" |
13 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
14 #include "services/navigation/public/interfaces/view.mojom.h" | 14 #include "services/navigation/public/interfaces/view.mojom.h" |
15 #include "services/shell/public/cpp/interface_factory.h" | 15 #include "services/shell/public/cpp/interface_factory.h" |
16 #include "services/shell/public/cpp/service.h" | 16 #include "services/shell/public/cpp/service.h" |
17 #include "services/shell/public/cpp/shell_connection_ref.h" | 17 #include "services/shell/public/cpp/service_context_ref.h" |
18 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 18 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
19 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
20 #include "ui/views/widget/widget_delegate.h" | 20 #include "ui/views/widget/widget_delegate.h" |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 class WebView; | 23 class WebView; |
24 class Widget; | 24 class Widget; |
25 } | 25 } |
26 | 26 |
27 namespace navigation { | 27 namespace navigation { |
28 | 28 |
29 class ViewImpl : public mojom::View, | 29 class ViewImpl : public mojom::View, |
30 public content::WebContentsDelegate, | 30 public content::WebContentsDelegate, |
31 public content::NotificationObserver, | 31 public content::NotificationObserver, |
32 public ui::WindowTreeClientDelegate, | 32 public ui::WindowTreeClientDelegate, |
33 public views::WidgetDelegate { | 33 public views::WidgetDelegate { |
34 public: | 34 public: |
35 ViewImpl(shell::Connector* connector, | 35 ViewImpl(shell::Connector* connector, |
36 const std::string& client_user_id, | 36 const std::string& client_user_id, |
37 mojom::ViewClientPtr client, | 37 mojom::ViewClientPtr client, |
38 mojom::ViewRequest request, | 38 mojom::ViewRequest request, |
39 std::unique_ptr<shell::ShellConnectionRef> ref); | 39 std::unique_ptr<shell::ServiceContextRef> ref); |
40 ~ViewImpl() override; | 40 ~ViewImpl() override; |
41 | 41 |
42 private: | 42 private: |
43 // mojom::View: | 43 // mojom::View: |
44 void NavigateTo(const GURL& url) override; | 44 void NavigateTo(const GURL& url) override; |
45 void GoBack() override; | 45 void GoBack() override; |
46 void GoForward() override; | 46 void GoForward() override; |
47 void NavigateToOffset(int offset) override; | 47 void NavigateToOffset(int offset) override; |
48 void Reload(bool skip_cache) override; | 48 void Reload(bool skip_cache) override; |
49 void Stop() override; | 49 void Stop() override; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void OnEventObserved(const ui::Event& event, ui::Window* target) override; | 83 void OnEventObserved(const ui::Event& event, ui::Window* target) override; |
84 | 84 |
85 // views::WidgetDelegate: | 85 // views::WidgetDelegate: |
86 views::View* GetContentsView() override; | 86 views::View* GetContentsView() override; |
87 views::Widget* GetWidget() override; | 87 views::Widget* GetWidget() override; |
88 const views::Widget* GetWidget() const override; | 88 const views::Widget* GetWidget() const override; |
89 | 89 |
90 shell::Connector* connector_; | 90 shell::Connector* connector_; |
91 mojo::StrongBinding<mojom::View> binding_; | 91 mojo::StrongBinding<mojom::View> binding_; |
92 mojom::ViewClientPtr client_; | 92 mojom::ViewClientPtr client_; |
93 std::unique_ptr<shell::ShellConnectionRef> ref_; | 93 std::unique_ptr<shell::ServiceContextRef> ref_; |
94 | 94 |
95 views::WebView* web_view_; | 95 views::WebView* web_view_; |
96 | 96 |
97 std::unique_ptr<content::WebContents> web_contents_; | 97 std::unique_ptr<content::WebContents> web_contents_; |
98 | 98 |
99 content::NotificationRegistrar registrar_; | 99 content::NotificationRegistrar registrar_; |
100 | 100 |
101 std::unique_ptr<views::Widget> widget_; | 101 std::unique_ptr<views::Widget> widget_; |
102 | 102 |
103 gfx::Size resizer_size_; | 103 gfx::Size resizer_size_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(ViewImpl); | 105 DISALLOW_COPY_AND_ASSIGN(ViewImpl); |
106 }; | 106 }; |
107 | 107 |
108 } // navigation | 108 } // navigation |
109 | 109 |
110 #endif // SERVICES_NAVIGATION_VIEW_IMPL_H_ | 110 #endif // SERVICES_NAVIGATION_VIEW_IMPL_H_ |
OLD | NEW |