OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/view_manager/native_viewport/platform_viewport.h" | 5 #include "components/view_manager/native_viewport/platform_viewport.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "components/view_manager/public/interfaces/view_manager.mojom.h" |
8 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
9 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
10 #include "ui/events/event.h" | 11 #include "ui/events/event.h" |
11 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
12 #include "ui/platform_window/platform_window_delegate.h" | 13 #include "ui/platform_window/platform_window_delegate.h" |
13 #include "ui/platform_window/win/win_window.h" | 14 #include "ui/platform_window/win/win_window.h" |
14 | 15 |
15 namespace native_viewport { | 16 namespace native_viewport { |
16 namespace { | 17 namespace { |
17 float ConvertUIWheelValueToMojoValue(int offset) { | 18 float ConvertUIWheelValueToMojoValue(int offset) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void OnActivationChanged(bool active) override {} | 127 void OnActivationChanged(bool active) override {} |
127 | 128 |
128 scoped_ptr<ui::PlatformWindow> platform_window_; | 129 scoped_ptr<ui::PlatformWindow> platform_window_; |
129 Delegate* delegate_; | 130 Delegate* delegate_; |
130 mojo::ViewportMetricsPtr metrics_; | 131 mojo::ViewportMetricsPtr metrics_; |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(PlatformViewportWin); | 133 DISALLOW_COPY_AND_ASSIGN(PlatformViewportWin); |
133 }; | 134 }; |
134 | 135 |
135 // static | 136 // static |
136 scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) { | 137 scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate, |
| 138 bool headless) { |
| 139 if (headless) |
| 140 return PlatformViewportHeadless::Create(delegate); |
137 return scoped_ptr<PlatformViewport>(new PlatformViewportWin(delegate)).Pass(); | 141 return scoped_ptr<PlatformViewport>(new PlatformViewportWin(delegate)).Pass(); |
138 } | 142 } |
139 | 143 |
140 } // namespace native_viewport | 144 } // namespace native_viewport |
OLD | NEW |