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

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 ShelfAlignment GetAlignment() const;
38 void SetAlignment(ShelfAlignment alignmnet);
39
40 // Sets/gets the shelf auto-hide behavior.
41 ShelfAutoHideBehavior GetAutoHideBehavior() const;
42 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior);
43
44 // Sets whether the launcher paints a background. Default is false, but is set
45 // to true if a window overlaps the shelf.
46 void SetPaintsBackground(
47 bool value,
48 internal::BackgroundAnimator::ChangeType change_type);
49 bool paints_background() const {
50 return background_animator_.paints_background();
51 }
52
53 // Causes shelf items to be slightly dimmed.
54 void SetDimsShelf(bool dimming);
55 bool GetDimsShelf() const;
56
57 internal::ShelfLayoutManager* shelf_layout_manager() {
58 return shelf_layout_manager_;
59 }
60 Launcher* launcher() const { return launcher_.get(); }
61 internal::StatusAreaWidget* status_area_widget() const {
62 return status_area_widget_;
63 }
64
65 void CreateLauncher();
Mr4D (OOO till 08-26) 2013/03/02 02:02:12 Here are only a few comments. Maybe add a few?
Harry McCleave 2013/03/04 02:47:41 Done.
66 bool LauncherVisible() const;
67 void SetLauncherVisibility(bool visible);
68
69 // Sets the focus cycler. Also adds the launcher to the cycle.
70 void SetFocusCycler(internal::FocusCycler* focus_cycler);
71 internal::FocusCycler* GetFocusCycler();
72
73 // Called by the activation delegate, before the launcher is activated
74 // when no other windows are visible.
75 void WillActivateAsFallback() { activating_as_fallback_ = true; }
76
77 // Overridden from views::WidgetObserver:
78 virtual void OnWidgetActivationChanged(
79 views::Widget* widget, bool active) OVERRIDE;
80
81 aura::Window* window_container() { return window_container_; }
Mr4D (OOO till 08-26) 2013/03/02 02:02:12 empty line before private
Harry McCleave 2013/03/04 02:47:41 Done.
Harry McCleave 2013/03/04 02:47:41 Done.
82 private:
83 class DelegateView;
84
85 internal::ShelfLayoutManager* shelf_layout_manager_;
86 scoped_ptr<Launcher> launcher_;
87 internal::StatusAreaWidget* status_area_widget_;
88 DelegateView* delegate_view_;
89 internal::BackgroundAnimator background_animator_;
90 bool activating_as_fallback_;
91 aura::Window* window_container_;
92 };
93
94 } // namespace ash
95
96 #endif // ASH_SHELF_SHELF_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698