OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_SHELF_SHELF_WIDGET_H_ | |
6 #define ASH_SHELF_SHELF_WIDGET_H_ | |
7 | |
8 #include "ash/ash_export.h" | |
9 #include "ash/shelf/background_animator.h" | |
10 #include "ash/shelf/shelf_types.h" | |
11 #include "ui/views/widget/widget.h" | |
12 #include "ui/views/widget/widget_observer.h" | |
13 | |
14 namespace aura { | |
15 class Window; | |
16 } | |
17 | |
18 namespace ash { | |
19 class Launcher; | |
20 | |
21 namespace internal { | |
22 class FocusCycler; | |
23 class StatusAreaWidget; | |
24 class ShelfLayoutManager; | |
25 class WorkspaceController; | |
26 } | |
27 | |
28 class ASH_EXPORT ShelfWidget : public views::Widget, | |
29 public views::WidgetObserver { | |
30 public: | |
31 ShelfWidget( | |
32 aura::Window* shelf_container, | |
33 aura::Window* status_container, | |
34 internal::WorkspaceController* workspace_controller); | |
35 virtual ~ShelfWidget(); | |
36 | |
37 // Set the alignment of the shelf. | |
James Cook
2013/03/05 20:30:38
This comment is not useful. Either explain that la
Harry McCleave
2013/03/06 01:59:49
Done.
| |
38 void SetAlignment(ShelfAlignment alignmnet); | |
39 ShelfAlignment GetAlignment() const; | |
40 | |
41 // Sets/gets the shelf auto-hide behavior. | |
James Cook
2013/03/05 20:30:38
ditto
Harry McCleave
2013/03/06 01:59:49
Done.
| |
42 ShelfAutoHideBehavior GetAutoHideBehavior() const; | |
43 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior); | |
44 | |
45 // Sets whether the shelf paints a background. Default is false, but is set | |
James Cook
2013/03/05 20:30:38
For example, this is a much more useful comment.
| |
46 // to true if a window overlaps the shelf. | |
47 void SetPaintsBackground( | |
48 bool value, | |
49 internal::BackgroundAnimator::ChangeType change_type); | |
50 bool paints_background() const { | |
51 return background_animator_.paints_background(); | |
52 } | |
53 | |
54 // Causes shelf items to be slightly dimmed. | |
55 void SetDimsShelf(bool dimming); | |
56 bool GetDimsShelf() const; | |
57 | |
58 internal::ShelfLayoutManager* shelf_layout_manager() { | |
59 return shelf_layout_manager_; | |
60 } | |
61 Launcher* launcher() const { return launcher_.get(); } | |
62 internal::StatusAreaWidget* status_area_widget() const { | |
63 return status_area_widget_; | |
64 } | |
65 | |
66 void CreateLauncher(); | |
67 | |
68 // Set visibility of the launcher component is visible on the shelf. | |
James Cook
2013/03/05 20:30:38
"Set visibility of the launcher component on the s
Harry McCleave
2013/03/06 01:59:49
I can has english readability plz?
| |
69 void SetLauncherVisibility(bool visible); | |
70 bool LauncherVisible() const; | |
James Cook
2013/03/05 20:30:38
Maybe IsLauncherVisible()?
Harry McCleave
2013/03/06 01:59:49
Done.
| |
71 | |
72 // Sets the focus cycler. Also adds the launcher to the cycle. | |
73 void SetFocusCycler(internal::FocusCycler* focus_cycler); | |
74 internal::FocusCycler* GetFocusCycler(); | |
75 | |
76 // Called by the activation delegate, before the launcher is activated | |
77 // when no other windows are visible. | |
78 void WillActivateAsFallback() { activating_as_fallback_ = true; } | |
79 | |
80 // Overridden from views::WidgetObserver: | |
81 virtual void OnWidgetActivationChanged( | |
82 views::Widget* widget, bool active) OVERRIDE; | |
83 | |
84 aura::Window* window_container() { return window_container_; } | |
James Cook
2013/03/05 20:30:38
Hooray, no const!
| |
85 | |
86 private: | |
87 class DelegateView; | |
88 | |
89 internal::ShelfLayoutManager* shelf_layout_manager_; | |
90 scoped_ptr<Launcher> launcher_; | |
91 internal::StatusAreaWidget* status_area_widget_; | |
92 DelegateView* delegate_view_; | |
James Cook
2013/03/05 20:30:38
Comment on the memory ownership of this view (sinc
Harry McCleave
2013/03/06 01:59:49
Done.
| |
93 internal::BackgroundAnimator background_animator_; | |
94 bool activating_as_fallback_; | |
95 aura::Window* window_container_; | |
96 }; | |
97 | |
98 } // namespace ash | |
99 | |
100 #endif // ASH_SHELF_SHELF_WIDGET_H_ | |
OLD | NEW |