| OLD | NEW |
| 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "components/mus/public/cpp/input_event_handler.h" |
| 12 #include "components/mus/public/cpp/scoped_window_ptr.h" | 13 #include "components/mus/public/cpp/scoped_window_ptr.h" |
| 13 #include "components/mus/public/cpp/window.h" | 14 #include "components/mus/public/cpp/window.h" |
| 14 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 15 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 15 #include "content/public/browser/render_process_host_observer.h" | 16 #include "content/public/browser/render_process_host_observer.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 class RenderWidgetHost; | 20 class RenderWidgetHost; |
| 20 class RenderWidgetHostImpl; | 21 class RenderWidgetHostImpl; |
| 21 struct NativeWebKeyboardEvent; | 22 struct NativeWebKeyboardEvent; |
| 22 struct TextInputState; | 23 struct TextInputState; |
| 23 | 24 |
| 24 // See comments in render_widget_host_view.h about this class and its members. | 25 // See comments in render_widget_host_view.h about this class and its members. |
| 25 // This version of RenderWidgetHostView is for builds of Chrome that run through | 26 // This version of RenderWidgetHostView is for builds of Chrome that run through |
| 26 // the mojo shell and use the Mandoline UI Service (Mus). Mus is responsible for | 27 // the mojo shell and use the Mandoline UI Service (Mus). Mus is responsible for |
| 27 // windowing, compositing, and input event dispatch. The purpose of | 28 // windowing, compositing, and input event dispatch. The purpose of |
| 28 // RenderWidgetHostViewMus is to manage the mus::Window owned by the content | 29 // RenderWidgetHostViewMus is to manage the mus::Window owned by the content |
| 29 // embedder. The browser is the owner of the mus::Window, controlling properties | 30 // embedder. The browser is the owner of the mus::Window, controlling properties |
| 30 // such as visibility, and bounds. Some aspects such as input, focus, and cursor | 31 // such as visibility, and bounds. Some aspects such as input, focus, and cursor |
| 31 // are managed by Mus directly. Input event routing will be plumbed directly to | 32 // are managed by Mus directly. Input event routing will be plumbed directly to |
| 32 // the renderer from Mus. | 33 // the renderer from Mus. |
| 33 class CONTENT_EXPORT RenderWidgetHostViewMus : public RenderWidgetHostViewBase { | 34 class CONTENT_EXPORT RenderWidgetHostViewMus |
| 35 : public RenderWidgetHostViewBase, |
| 36 NON_EXPORTED_BASE(public mus::InputEventHandler) { |
| 34 public: | 37 public: |
| 35 RenderWidgetHostViewMus(mus::Window* parent_window, | 38 RenderWidgetHostViewMus(mus::Window* parent_window, |
| 36 RenderWidgetHostImpl* widget); | 39 RenderWidgetHostImpl* widget); |
| 37 ~RenderWidgetHostViewMus() override; | 40 ~RenderWidgetHostViewMus() override; |
| 38 | 41 |
| 39 private: | 42 private: |
| 40 // Set the bounds of the window and handle size changes. Assumes the caller | 43 // Set the bounds of the window and handle size changes. Assumes the caller |
| 41 // has already adjusted the origin of |rect| to conform to whatever coordinate | 44 // has already adjusted the origin of |rect| to conform to whatever coordinate |
| 42 // space is required by the aura::Window. | 45 // space is required by the aura::Window. |
| 43 void InternalSetBounds(const gfx::Rect& rect); | 46 void InternalSetBounds(const gfx::Rect& rect); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void ShowDefinitionForSelection() override; | 110 void ShowDefinitionForSelection() override; |
| 108 bool SupportsSpeech() const override; | 111 bool SupportsSpeech() const override; |
| 109 void SpeakSelection() override; | 112 void SpeakSelection() override; |
| 110 bool IsSpeaking() const override; | 113 bool IsSpeaking() const override; |
| 111 void StopSpeaking() override; | 114 void StopSpeaking() override; |
| 112 #endif // defined(OS_MACOSX) | 115 #endif // defined(OS_MACOSX) |
| 113 | 116 |
| 114 void LockCompositingSurface() override; | 117 void LockCompositingSurface() override; |
| 115 void UnlockCompositingSurface() override; | 118 void UnlockCompositingSurface() override; |
| 116 | 119 |
| 120 // mus::InputEventHandler: |
| 121 void OnWindowInputEvent( |
| 122 mus::Window* target, |
| 123 const ui::Event& event, |
| 124 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>* |
| 125 ack_callback) override; |
| 126 |
| 117 RenderWidgetHostImpl* host_; | 127 RenderWidgetHostImpl* host_; |
| 118 | 128 |
| 119 aura::Window* aura_window_; | 129 aura::Window* aura_window_; |
| 120 | 130 |
| 121 std::unique_ptr<mus::ScopedWindowPtr> mus_window_; | 131 std::unique_ptr<mus::ScopedWindowPtr> mus_window_; |
| 122 | 132 |
| 123 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMus); | 133 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMus); |
| 124 }; | 134 }; |
| 125 | 135 |
| 126 } // namespace content | 136 } // namespace content |
| 127 | 137 |
| 128 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ | 138 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ |
| OLD | NEW |