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

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_item_controller.h

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Cleanup; fix ash_shell compile and a couple tests. Created 3 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
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 30 matching lines...) Expand all
41 DCHECK(locked_); 41 DCHECK(locked_);
42 locked_--; 42 locked_--;
43 } 43 }
44 bool locked() const { return locked_ > 0; } 44 bool locked() const { return locked_ > 0; }
45 45
46 bool image_set_by_controller() const { return image_set_by_controller_; } 46 bool image_set_by_controller() const { return image_set_by_controller_; }
47 void set_image_set_by_controller(bool image_set_by_controller) { 47 void set_image_set_by_controller(bool image_set_by_controller) {
48 image_set_by_controller_ = image_set_by_controller; 48 image_set_by_controller_ = image_set_by_controller;
49 } 49 }
50 50
51 // Returns items for the application menu; used for convenience and testing.
52 virtual MenuItemList GetAppMenuItems(int event_flags);
53
51 // Returns nullptr if class is not AppWindowLauncherItemController. 54 // Returns nullptr if class is not AppWindowLauncherItemController.
52 virtual AppWindowLauncherItemController* AsAppWindowLauncherItemController(); 55 virtual AppWindowLauncherItemController* AsAppWindowLauncherItemController();
53 56
54 private: 57 private:
55 // The application id; empty if there is no app associated with the item. 58 // The application id; empty if there is no app associated with the item.
56 const std::string app_id_; 59 const std::string app_id_;
57 60
58 // An id that can be passed to an app when launched in order to support 61 // An id that can be passed to an app when launched in order to support
59 // multiple shelf items per app. This id is used together with the app_id to 62 // multiple shelf items per app. This id is used together with the app_id to
60 // uniquely identify each shelf item that has the same app_id. 63 // uniquely identify each shelf item that has the same app_id.
61 const std::string launch_id_; 64 const std::string launch_id_;
62 65
63 // A unique id assigned by the shelf model for the shelf item. 66 // A unique id assigned by the shelf model for the shelf item.
64 ash::ShelfID shelf_id_; 67 ash::ShelfID shelf_id_;
65 68
66 ChromeLauncherController* launcher_controller_; 69 ChromeLauncherController* launcher_controller_;
67 70
68 // The lock counter which tells the launcher if the item can be removed from 71 // The lock counter which tells the launcher if the item can be removed from
69 // the launcher (0) or not (>0). It is being used for windowed V1 72 // the launcher (0) or not (>0). It is being used for windowed V1
70 // applications. 73 // applications.
71 int locked_; 74 int locked_;
72 75
73 // Set to true if the launcher item image has been set by the controller. 76 // Set to true if the launcher item image has been set by the controller.
74 bool image_set_by_controller_; 77 bool image_set_by_controller_;
75 78
76 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); 79 DISALLOW_COPY_AND_ASSIGN(LauncherItemController);
77 }; 80 };
78 81
79 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ 82 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698