Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1274)

Side by Side Diff: ash/shell.h

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: removed app_list_delegate_impl and made shell an AppListDelegate Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/session/session_observer.h" 15 #include "ash/session/session_observer.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/app_list/presenter/app_list_delegate.h"
21 #include "ui/aura/window.h" 22 #include "ui/aura/window.h"
22 #include "ui/display/screen.h" 23 #include "ui/display/screen.h"
23 #include "ui/events/event_target.h" 24 #include "ui/events/event_target.h"
24 #include "ui/wm/core/cursor_manager.h" 25 #include "ui/wm/core/cursor_manager.h"
25 #include "ui/wm/public/activation_change_observer.h" 26 #include "ui/wm/public/activation_change_observer.h"
26 27
27 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
28 #include "ash/wm/cursor_manager_chromeos.h" 29 #include "ash/wm/cursor_manager_chromeos.h"
29 #endif // defined(OS_CHROMEOS) 30 #endif // defined(OS_CHROMEOS)
30 31
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 class FocusController; 85 class FocusController;
85 class ShadowController; 86 class ShadowController;
86 class VisibilityController; 87 class VisibilityController;
87 class WindowModalityController; 88 class WindowModalityController;
88 } 89 }
89 90
90 namespace ash { 91 namespace ash {
91 92
92 class AcceleratorController; 93 class AcceleratorController;
93 class AccessibilityDelegate; 94 class AccessibilityDelegate;
94 class AppListDelegateImpl;
95 class AshNativeCursorManager; 95 class AshNativeCursorManager;
96 class AshTouchTransformController; 96 class AshTouchTransformController;
97 class AutoclickController; 97 class AutoclickController;
98 class BluetoothNotificationController; 98 class BluetoothNotificationController;
99 class BrightnessControlDelegate; 99 class BrightnessControlDelegate;
100 class CastConfigController; 100 class CastConfigController;
101 class DisplayColorManager; 101 class DisplayColorManager;
102 class DisplayConfigurationController; 102 class DisplayConfigurationController;
103 class DisplayErrorObserver; 103 class DisplayErrorObserver;
104 class DragDropController; 104 class DragDropController;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 // Shell is a singleton object that presents the Shell API and implements the 188 // Shell is a singleton object that presents the Shell API and implements the
189 // RootWindow's delegate interface. 189 // RootWindow's delegate interface.
190 // 190 //
191 // Upon creation, the Shell sets itself as the RootWindow's delegate, which 191 // Upon creation, the Shell sets itself as the RootWindow's delegate, which
192 // takes ownership of the Shell. 192 // takes ownership of the Shell.
193 class ASH_EXPORT Shell : public SessionObserver, 193 class ASH_EXPORT Shell : public SessionObserver,
194 public SystemModalContainerEventFilterDelegate, 194 public SystemModalContainerEventFilterDelegate,
195 public ui::EventTarget, 195 public ui::EventTarget,
196 public ::wm::ActivationChangeObserver { 196 public ::wm::ActivationChangeObserver,
197 public app_list::AppListDelegate {
197 public: 198 public:
198 typedef std::vector<RootWindowController*> RootWindowControllerList; 199 typedef std::vector<RootWindowController*> RootWindowControllerList;
199 200
200 // A shell must be explicitly created so that it can call |Init()| with the 201 // A shell must be explicitly created so that it can call |Init()| with the
201 // delegate set. |delegate| can be NULL (if not required for initialization). 202 // delegate set. |delegate| can be NULL (if not required for initialization).
202 // Takes ownership of |delegate|. 203 // Takes ownership of |delegate|.
203 static Shell* CreateInstance(const ShellInitParams& init_params); 204 static Shell* CreateInstance(const ShellInitParams& init_params);
204 205
205 // Should never be called before |CreateInstance()|. 206 // Should never be called before |CreateInstance()|.
206 static Shell* Get(); 207 static Shell* Get();
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 // GetAppListTargetVisibility() when hiding animation is still in flight. 553 // GetAppListTargetVisibility() when hiding animation is still in flight.
553 bool IsAppListVisible() const; 554 bool IsAppListVisible() const;
554 555
555 // Returns app list target visibility. 556 // Returns app list target visibility.
556 bool GetAppListTargetVisibility() const; 557 bool GetAppListTargetVisibility() const;
557 558
558 // Called when the login status changes. 559 // Called when the login status changes.
559 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. 560 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
560 void UpdateAfterLoginStatusChange(LoginStatus status); 561 void UpdateAfterLoginStatusChange(LoginStatus status);
561 562
563 // Notifies observers that the AppList has been shown or dismissed.
564 void NotifyAppListShownOrDismissed(bool shown, aura::Window* root_window);
565
562 // Notifies observers that maximize mode has started, windows might still 566 // Notifies observers that maximize mode has started, windows might still
563 // animate. 567 // animate.
564 void NotifyMaximizeModeStarted(); 568 void NotifyMaximizeModeStarted();
565 569
566 // Notifies observers that maximize mode is about to end. 570 // Notifies observers that maximize mode is about to end.
567 void NotifyMaximizeModeEnding(); 571 void NotifyMaximizeModeEnding();
568 572
569 // Notifies observers that maximize mode has ended, windows might still be 573 // Notifies observers that maximize mode has ended, windows might still be
570 // returning to their original position. 574 // returning to their original position.
571 void NotifyMaximizeModeEnded(); 575 void NotifyMaximizeModeEnded();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 bool CanAcceptEvent(const ui::Event& event) override; 644 bool CanAcceptEvent(const ui::Event& event) override;
641 EventTarget* GetParentTarget() override; 645 EventTarget* GetParentTarget() override;
642 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; 646 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
643 ui::EventTargeter* GetEventTargeter() override; 647 ui::EventTargeter* GetEventTargeter() override;
644 648
645 // wm::ActivationChangeObserver: 649 // wm::ActivationChangeObserver:
646 void OnWindowActivated(ActivationReason reason, 650 void OnWindowActivated(ActivationReason reason,
647 aura::Window* gained_active, 651 aura::Window* gained_active,
648 aura::Window* lost_active) override; 652 aura::Window* lost_active) override;
649 653
654 // Overridden from app_list::AppListDelegate:
655 void OnAppListVisibilityChanged(bool visible, int64_t display_id_) override;
656
650 // SessionObserver: 657 // SessionObserver:
651 void OnSessionStateChanged(session_manager::SessionState state) override; 658 void OnSessionStateChanged(session_manager::SessionState state) override;
652 void OnLoginStatusChanged(LoginStatus login_status) override; 659 void OnLoginStatusChanged(LoginStatus login_status) override;
653 void OnLockStateChanged(bool locked) override; 660 void OnLockStateChanged(bool locked) override;
654 661
655 // Finalizes the shelf state. Called after the user session is active and 662 // Finalizes the shelf state. Called after the user session is active and
656 // the profile is available. 663 // the profile is available.
657 void InitializeShelf(); 664 void InitializeShelf();
658 665
659 // Callback for prefs::ConnectToPrefService. 666 // Callback for prefs::ConnectToPrefService.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 821
815 // See comment for GetRootWindowForNewWindows(). 822 // See comment for GetRootWindowForNewWindows().
816 aura::Window* root_window_for_new_windows_ = nullptr; 823 aura::Window* root_window_for_new_windows_ = nullptr;
817 aura::Window* scoped_root_window_for_new_windows_ = nullptr; 824 aura::Window* scoped_root_window_for_new_windows_ = nullptr;
818 825
819 // Injected content::GPUDataManager support. 826 // Injected content::GPUDataManager support.
820 std::unique_ptr<GPUSupport> gpu_support_; 827 std::unique_ptr<GPUSupport> gpu_support_;
821 828
822 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_; 829 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_;
823 830
824 std::unique_ptr<AppListDelegateImpl> app_list_delegate_impl_;
825
826 base::ObserverList<ShellObserver> shell_observers_; 831 base::ObserverList<ShellObserver> shell_observers_;
827 832
828 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; 833 scoped_refptr<base::SequencedWorkerPool> blocking_pool_;
829 834
830 DISALLOW_COPY_AND_ASSIGN(Shell); 835 DISALLOW_COPY_AND_ASSIGN(Shell);
831 }; 836 };
832 837
833 } // namespace ash 838 } // namespace ash
834 839
835 #endif // ASH_SHELL_H_ 840 #endif // ASH_SHELL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698