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