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

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

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Removed header include in shell.h that was causing gn check failure. 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
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shelf/app_list_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SHELF_APP_LIST_BUTTON_H_ 5 #ifndef ASH_SHELF_APP_LIST_BUTTON_H_
6 #define ASH_SHELF_APP_LIST_BUTTON_H_ 6 #define ASH_SHELF_APP_LIST_BUTTON_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/shell_observer.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "third_party/skia/include/core/SkColor.h" 13 #include "third_party/skia/include/core/SkColor.h"
13 #include "ui/views/controls/button/image_button.h" 14 #include "ui/views/controls/button/image_button.h"
14 15
15 namespace ash { 16 namespace ash {
16 class InkDropButtonListener; 17 class InkDropButtonListener;
17 class Shelf; 18 class Shelf;
18 class ShelfView; 19 class ShelfView;
19 20
20 // Button used for the AppList icon on the shelf. 21 // Button used for the AppList icon on the shelf.
21 class ASH_EXPORT AppListButton : public views::ImageButton { 22 class ASH_EXPORT AppListButton : public views::ImageButton,
23 public ShellObserver {
22 public: 24 public:
23 AppListButton(InkDropButtonListener* listener, 25 AppListButton(InkDropButtonListener* listener,
24 ShelfView* shelf_view, 26 ShelfView* shelf_view,
25 Shelf* shelf); 27 Shelf* shelf);
26 ~AppListButton() override; 28 ~AppListButton() override;
27 29
28 void OnAppListShown(); 30 void OnAppListShown();
29 void OnAppListDismissed(); 31 void OnAppListDismissed();
30 32
31 bool is_showing_app_list() const { return is_showing_app_list_; } 33 bool is_showing_app_list() const { return is_showing_app_list_; }
(...skipping 16 matching lines...) Expand all
48 bool ShouldEnterPushedState(const ui::Event& event) override; 50 bool ShouldEnterPushedState(const ui::Event& event) override;
49 std::unique_ptr<views::InkDrop> CreateInkDrop() override; 51 std::unique_ptr<views::InkDrop> CreateInkDrop() override;
50 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; 52 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
51 void PaintButtonContents(gfx::Canvas* canvas) override; 53 void PaintButtonContents(gfx::Canvas* canvas) override;
52 54
53 private: 55 private:
54 // Get the center point of the app list button used to draw its background and 56 // Get the center point of the app list button used to draw its background and
55 // ink drops. 57 // ink drops.
56 gfx::Point GetCenterPoint() const; 58 gfx::Point GetCenterPoint() const;
57 59
60 // ShellObserver overrides:
61 void OnAppListVisibilityChanged(bool shown,
62 aura::Window* root_window) override;
63
58 // True if the app list is currently showing for this display. 64 // True if the app list is currently showing for this display.
59 // This is useful because other IsApplistVisible functions aren't per-display. 65 // This is useful because other IsApplistVisible functions aren't per-display.
60 bool is_showing_app_list_; 66 bool is_showing_app_list_;
61 67
62 // Color used to paint the background. 68 // Color used to paint the background.
63 SkColor background_color_; 69 SkColor background_color_;
64 70
65 InkDropButtonListener* listener_; 71 InkDropButtonListener* listener_;
66 ShelfView* shelf_view_; 72 ShelfView* shelf_view_;
67 Shelf* shelf_; 73 Shelf* shelf_;
68 74
69 DISALLOW_COPY_AND_ASSIGN(AppListButton); 75 DISALLOW_COPY_AND_ASSIGN(AppListButton);
70 }; 76 };
71 77
72 } // namespace ash 78 } // namespace ash
73 79
74 #endif // ASH_SHELF_APP_LIST_BUTTON_H_ 80 #endif // ASH_SHELF_APP_LIST_BUTTON_H_
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shelf/app_list_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698