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

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: safer shutdown (status_area_widget_) 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
« no previous file with comments | « ash/shelf/shelf_types.h ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 void SetAlignment(ShelfAlignment alignmnet);
38 ShelfAlignment GetAlignment() const;
39
40 ShelfAutoHideBehavior GetAutoHideBehavior() const;
41 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
42
43 // Sets whether the shelf paints a background. Default is false, but is set
44 // to true if a window overlaps the shelf.
45 void SetPaintsBackground(
46 bool value,
47 internal::BackgroundAnimator::ChangeType change_type);
48 bool paints_background() const {
49 return background_animator_.paints_background();
50 }
51
52 // Causes shelf items to be slightly dimmed (eg when a window is maximized).
53 void SetDimsShelf(bool dimming);
54 bool GetDimsShelf() const;
55
56 internal::ShelfLayoutManager* shelf_layout_manager() {
57 return shelf_layout_manager_;
58 }
59 Launcher* launcher() const { return launcher_.get(); }
60 internal::StatusAreaWidget* status_area_widget() const {
61 return status_area_widget_;
62 }
63
64 void CreateLauncher();
65
66 // Set visibility of the launcher component of the shelf.
67 void SetLauncherVisibility(bool visible);
68 bool IsLauncherVisible() const;
69
70 // Sets the focus cycler. Also adds the launcher to the cycle.
71 void SetFocusCycler(internal::FocusCycler* focus_cycler);
72 internal::FocusCycler* GetFocusCycler();
73
74 // Called by the activation delegate, before the launcher is activated
75 // when no other windows are visible.
76 void WillActivateAsFallback() { activating_as_fallback_ = true; }
77
78 // Overridden from views::WidgetObserver:
79 virtual void OnWidgetActivationChanged(
80 views::Widget* widget, bool active) OVERRIDE;
81
82 aura::Window* window_container() { return window_container_; }
83
84 // TODO(harrym): Remove when Status Area Widget is a child view.
85 void ShutdownStatusAreaWidget();
86
87 private:
88 class DelegateView;
89
90 internal::ShelfLayoutManager* shelf_layout_manager_;
91 scoped_ptr<Launcher> launcher_;
92 internal::StatusAreaWidget* status_area_widget_;
93
94 // delegate_view_ is attached to window_container_ and is cleaned up
95 // during CloseChildWindows of the associated RootWindowController.
96 DelegateView* delegate_view_;
97 internal::BackgroundAnimator background_animator_;
98 bool activating_as_fallback_;
99 aura::Window* window_container_;
100 };
101
102 } // namespace ash
103
104 #endif // ASH_SHELF_SHELF_WIDGET_H_
OLDNEW
« no previous file with comments | « ash/shelf/shelf_types.h ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698