| OLD | NEW | 
|   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  Loading... | 
|  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_ | 
| OLD | NEW |