| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/common/shelf/shelf_item_delegate.h" | 10 #include "ash/common/shelf/shelf_item_delegate.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 DCHECK(locked_); | 42 DCHECK(locked_); |
| 43 locked_--; | 43 locked_--; |
| 44 } | 44 } |
| 45 bool locked() const { return locked_ > 0; } | 45 bool locked() const { return locked_ > 0; } |
| 46 | 46 |
| 47 bool image_set_by_controller() const { return image_set_by_controller_; } | 47 bool image_set_by_controller() const { return image_set_by_controller_; } |
| 48 void set_image_set_by_controller(bool image_set_by_controller) { | 48 void set_image_set_by_controller(bool image_set_by_controller) { |
| 49 image_set_by_controller_ = image_set_by_controller; | 49 image_set_by_controller_ = image_set_by_controller; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Launches a new instance of the app associated with this item. | |
| 53 virtual void Launch(ash::LaunchSource source, int event_flags) = 0; | |
| 54 | |
| 55 // Shows and activates the most-recently-active window associated with the | 52 // Shows and activates the most-recently-active window associated with the |
| 56 // item, or launches the item if it is not currently open. | 53 // item, or launches the item if it is not currently open. |
| 57 // Returns the action performed by activating the item. | 54 // Returns the action performed by activating the item. |
| 58 virtual PerformedAction Activate(ash::LaunchSource source) = 0; | 55 virtual PerformedAction Activate(ash::LaunchSource source) = 0; |
| 59 | 56 |
| 60 // Returns nullptr if class is not AppWindowLauncherItemController. | 57 // Returns nullptr if class is not AppWindowLauncherItemController. |
| 61 virtual AppWindowLauncherItemController* AsAppWindowLauncherItemController(); | 58 virtual AppWindowLauncherItemController* AsAppWindowLauncherItemController(); |
| 62 | 59 |
| 63 private: | 60 private: |
| 64 // The application id; empty if there is no app associated with the item. | 61 // The application id; empty if there is no app associated with the item. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 79 // applications. | 76 // applications. |
| 80 int locked_; | 77 int locked_; |
| 81 | 78 |
| 82 // Set to true if the launcher item image has been set by the controller. | 79 // Set to true if the launcher item image has been set by the controller. |
| 83 bool image_set_by_controller_; | 80 bool image_set_by_controller_; |
| 84 | 81 |
| 85 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); | 82 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); |
| 86 }; | 83 }; |
| 87 | 84 |
| 88 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ | 85 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ |
| OLD | NEW |