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

Side by Side Diff: ash/shelf/shelf_widget.h

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
(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.
38 void SetAlignment(ShelfAlignment alignmnet);
39 ShelfAlignment GetAlignment() const;
40
41 // Sets/gets the shelf auto-hide behavior.
42 ShelfAutoHideBehavior GetAutoHideBehavior() const;
43 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
44
45 // Sets whether the shelf paints a background. Default is false, but is set
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.
69 void SetLauncherVisibility(bool visible);
70 bool LauncherVisible() const;
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_; }
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_;
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698