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

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

Issue 2033553003: Add MD ink drop ripple to shelf app items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed DLL export issue Created 4 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
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 "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/views/controls/button/image_button.h" 9 #include "ui/views/controls/button/image_button.h"
10 10
11 namespace ash { 11 namespace ash {
12 class InkDropButtonListener;
12 class ShelfView; 13 class ShelfView;
13 14
14 // Button used for the AppList icon on the shelf. 15 // Button used for the AppList icon on the shelf.
15 class AppListButton : public views::ImageButton { 16 class AppListButton : public views::ImageButton {
16 public: 17 public:
17 explicit AppListButton(ShelfView* shelf_view); 18 explicit AppListButton(InkDropButtonListener* listener,
19 ShelfView* shelf_view);
18 ~AppListButton() override; 20 ~AppListButton() override;
19 21
20 bool draw_background_as_active() { return draw_background_as_active_; } 22 bool draw_background_as_active() { return draw_background_as_active_; }
21 23
22 protected: 24 protected:
23 // views::ImageButton overrides: 25 // views::ImageButton overrides:
24 bool OnMousePressed(const ui::MouseEvent& event) override; 26 bool OnMousePressed(const ui::MouseEvent& event) override;
25 void OnMouseReleased(const ui::MouseEvent& event) override; 27 void OnMouseReleased(const ui::MouseEvent& event) override;
26 void OnMouseCaptureLost() override; 28 void OnMouseCaptureLost() override;
27 bool OnMouseDragged(const ui::MouseEvent& event) override; 29 bool OnMouseDragged(const ui::MouseEvent& event) override;
28 void OnPaint(gfx::Canvas* canvas) override; 30 void OnPaint(gfx::Canvas* canvas) override;
29 void GetAccessibleState(ui::AXViewState* state) override; 31 void GetAccessibleState(ui::AXViewState* state) override;
32 void NotifyClick(const ui::Event& event) override;
30 33
31 // ui::EventHandler overrides: 34 // ui::EventHandler overrides:
32 void OnGestureEvent(ui::GestureEvent* event) override; 35 void OnGestureEvent(ui::GestureEvent* event) override;
33 36
34 private: 37 private:
35 // Toggles the active state for painting the background and schedules a paint. 38 // Toggles the active state for painting the background and schedules a paint.
36 void SetDrawBackgroundAsActive(bool draw_background_as_active); 39 void SetDrawBackgroundAsActive(bool draw_background_as_active);
37 40
38 // True if the background should render as active, regardless of the state of 41 // True if the background should render as active, regardless of the state of
39 // the application list. 42 // the application list.
40 bool draw_background_as_active_; 43 bool draw_background_as_active_;
41 44
45 InkDropButtonListener* listener_;
42 ShelfView* shelf_view_; 46 ShelfView* shelf_view_;
43 47
44 DISALLOW_COPY_AND_ASSIGN(AppListButton); 48 DISALLOW_COPY_AND_ASSIGN(AppListButton);
45 }; 49 };
46 50
47 } // namespace ash 51 } // namespace ash
48 52
49 #endif // ASH_SHELF_APP_LIST_BUTTON_H_ 53 #endif // ASH_SHELF_APP_LIST_BUTTON_H_
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/shelf/app_list_button.cc » ('j') | ash/shelf/ink_drop_button_listener.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698