OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_SHELL_H_ | 5 #ifndef ASH_SHELL_H_ |
6 #define ASH_SHELL_H_ | 6 #define ASH_SHELL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
13 #include "ash/metrics/user_metrics_recorder.h" | 13 #include "ash/metrics/user_metrics_recorder.h" |
14 #include "ash/public/cpp/shelf_types.h" | 14 #include "ash/public/cpp/shelf_types.h" |
15 #include "ash/wm/cursor_manager_chromeos.h" | 15 #include "ash/wm/cursor_manager_chromeos.h" |
16 #include "ash/wm/system_modal_container_event_filter_delegate.h" | 16 #include "ash/wm/system_modal_container_event_filter_delegate.h" |
17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
22 #include "ui/display/screen.h" | 22 #include "ui/display/screen.h" |
23 #include "ui/events/event_target.h" | 23 #include "ui/events/event_target.h" |
24 #include "ui/wm/core/cursor_manager.h" | 24 #include "ui/wm/core/cursor_manager.h" |
25 | 25 |
26 namespace aura { | 26 namespace aura { |
27 class RootWindow; | 27 class RootWindow; |
28 class Window; | 28 class Window; |
29 class WindowTreeClient; | |
29 namespace client { | 30 namespace client { |
30 class ActivationClient; | 31 class ActivationClient; |
31 class FocusClient; | 32 class FocusClient; |
32 } | 33 } |
33 } | 34 } |
34 | 35 |
35 namespace chromeos { | 36 namespace chromeos { |
36 class AudioA11yController; | 37 class AudioA11yController; |
37 } | 38 } |
38 | 39 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 static int64_t GetTargetDisplayId(); | 178 static int64_t GetTargetDisplayId(); |
178 | 179 |
179 // Returns all root windows. | 180 // Returns all root windows. |
180 static aura::Window::Windows GetAllRootWindows(); | 181 static aura::Window::Windows GetAllRootWindows(); |
181 | 182 |
182 static aura::Window* GetContainer(aura::Window* root_window, | 183 static aura::Window* GetContainer(aura::Window* root_window, |
183 int container_id); | 184 int container_id); |
184 static const aura::Window* GetContainer(const aura::Window* root_window, | 185 static const aura::Window* GetContainer(const aura::Window* root_window, |
185 int container_id); | 186 int container_id); |
186 | 187 |
188 // TODO(sky): better isolate this. | |
James Cook
2017/01/10 22:41:14
Hrm. Yeah, this is kind of ugly. Could it live som
sky
2017/01/10 23:06:57
I put it in Shell as it isn't related to a single
| |
189 static void set_window_tree_client(aura::WindowTreeClient* client) { | |
190 window_tree_client_ = client; | |
191 } | |
192 | |
193 static aura::WindowTreeClient* window_tree_client() { | |
194 return window_tree_client_; | |
195 } | |
196 | |
187 // Creates a default views::NonClientFrameView for use by windows in the | 197 // Creates a default views::NonClientFrameView for use by windows in the |
188 // Ash environment. | 198 // Ash environment. |
189 views::NonClientFrameView* CreateDefaultNonClientFrameView( | 199 views::NonClientFrameView* CreateDefaultNonClientFrameView( |
190 views::Widget* widget); | 200 views::Widget* widget); |
191 | 201 |
192 // Sets work area insets of the display containing |window|, pings observers. | 202 // Sets work area insets of the display containing |window|, pings observers. |
193 void SetDisplayWorkAreaInsets(aura::Window* window, | 203 void SetDisplayWorkAreaInsets(aura::Window* window, |
194 const gfx::Insets& insets); | 204 const gfx::Insets& insets); |
195 | 205 |
196 // Called when the user logs in. | 206 // Called when the user logs in. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 bool CanWindowReceiveEvents(aura::Window* window) override; | 417 bool CanWindowReceiveEvents(aura::Window* window) override; |
408 | 418 |
409 // Overridden from ui::EventTarget: | 419 // Overridden from ui::EventTarget: |
410 bool CanAcceptEvent(const ui::Event& event) override; | 420 bool CanAcceptEvent(const ui::Event& event) override; |
411 EventTarget* GetParentTarget() override; | 421 EventTarget* GetParentTarget() override; |
412 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; | 422 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
413 ui::EventTargeter* GetEventTargeter() override; | 423 ui::EventTargeter* GetEventTargeter() override; |
414 | 424 |
415 static Shell* instance_; | 425 static Shell* instance_; |
416 | 426 |
427 static aura::WindowTreeClient* window_tree_client_; | |
James Cook
2017/01/10 22:41:14
Is this only set when running with mus? If so, ple
sky
2017/01/10 23:06:57
Done.
| |
428 | |
417 // If set before the Shell is initialized, the mouse cursor will be hidden | 429 // If set before the Shell is initialized, the mouse cursor will be hidden |
418 // when the screen is initially created. | 430 // when the screen is initially created. |
419 static bool initially_hide_cursor_; | 431 static bool initially_hide_cursor_; |
420 | 432 |
421 std::unique_ptr<ScopedOverviewAnimationSettingsFactoryAura> | 433 std::unique_ptr<ScopedOverviewAnimationSettingsFactoryAura> |
422 scoped_overview_animation_settings_factory_; | 434 scoped_overview_animation_settings_factory_; |
423 std::unique_ptr<WmShellAura> wm_shell_; | 435 std::unique_ptr<WmShellAura> wm_shell_; |
424 | 436 |
425 // The CompoundEventFilter owned by aura::Env object. | 437 // The CompoundEventFilter owned by aura::Env object. |
426 std::unique_ptr<::wm::CompoundEventFilter> env_filter_; | 438 std::unique_ptr<::wm::CompoundEventFilter> env_filter_; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
528 std::unique_ptr<GPUSupport> gpu_support_; | 540 std::unique_ptr<GPUSupport> gpu_support_; |
529 | 541 |
530 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_; | 542 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_; |
531 | 543 |
532 DISALLOW_COPY_AND_ASSIGN(Shell); | 544 DISALLOW_COPY_AND_ASSIGN(Shell); |
533 }; | 545 }; |
534 | 546 |
535 } // namespace ash | 547 } // namespace ash |
536 | 548 |
537 #endif // ASH_SHELL_H_ | 549 #endif // ASH_SHELL_H_ |
OLD | NEW |