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

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

Issue 2290603002: Enhance chrome.app.window API for shelf integration with pinning support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review v3 Created 4 years, 3 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 24 matching lines...) Expand all
35 public: 35 public:
36 enum Type { 36 enum Type {
37 TYPE_APP, 37 TYPE_APP,
38 TYPE_APP_PANEL, 38 TYPE_APP_PANEL,
39 TYPE_SHORTCUT, 39 TYPE_SHORTCUT,
40 TYPE_WINDOWED_APP 40 TYPE_WINDOWED_APP
41 }; 41 };
42 42
43 LauncherItemController(Type type, 43 LauncherItemController(Type type,
44 const std::string& app_id, 44 const std::string& app_id,
45 const std::string& launch_id,
45 ChromeLauncherController* launcher_controller); 46 ChromeLauncherController* launcher_controller);
46 ~LauncherItemController() override; 47 ~LauncherItemController() override;
47 48
48 Type type() const { return type_; } 49 Type type() const { return type_; }
49 ash::ShelfID shelf_id() const { return shelf_id_; } 50 ash::ShelfID shelf_id() const { return shelf_id_; }
50 void set_shelf_id(ash::ShelfID id) { shelf_id_ = id; } 51 void set_shelf_id(ash::ShelfID id) { shelf_id_ = id; }
51 const std::string& app_id() const { return app_id_; } 52 const std::string& app_id() const { return app_id_; }
53 const std::string& launch_id() const { return launch_id_; }
52 ChromeLauncherController* launcher_controller() const { 54 ChromeLauncherController* launcher_controller() const {
53 return launcher_controller_; 55 return launcher_controller_;
54 } 56 }
55 57
56 // Lock this item to the launcher without being pinned (windowed v1 apps). 58 // Lock this item to the launcher without being pinned (windowed v1 apps).
57 void lock() { locked_++; } 59 void lock() { locked_++; }
58 void unlock() { 60 void unlock() {
59 DCHECK(locked_); 61 DCHECK(locked_);
60 locked_--; 62 locked_--;
61 } 63 }
(...skipping 21 matching lines...) Expand all
83 // Called to retrieve the list of running applications. 85 // Called to retrieve the list of running applications.
84 virtual ChromeLauncherAppMenuItems GetApplicationList(int event_flags) = 0; 86 virtual ChromeLauncherAppMenuItems GetApplicationList(int event_flags) = 0;
85 87
86 // Helper function to get the ash::ShelfItemType for the item type. 88 // Helper function to get the ash::ShelfItemType for the item type.
87 ash::ShelfItemType GetShelfItemType() const; 89 ash::ShelfItemType GetShelfItemType() const;
88 90
89 private: 91 private:
90 const Type type_; 92 const Type type_;
91 // App id will be empty if there is no app associated with the window. 93 // App id will be empty if there is no app associated with the window.
92 const std::string app_id_; 94 const std::string app_id_;
95 // The launch id associated with the window.
stevenjb 2016/08/31 18:24:28 This doesn't explain what a 'launch id' is. This s
Andra Paraschiv 2016/09/01 08:27:25 Done.
96 const std::string launch_id_;
93 ash::ShelfID shelf_id_; 97 ash::ShelfID shelf_id_;
stevenjb 2016/08/31 18:24:27 Add a comment for shelf_id to help reduce the nami
Andra Paraschiv 2016/09/01 08:27:25 Done.
94 ChromeLauncherController* launcher_controller_; 98 ChromeLauncherController* launcher_controller_;
95 99
96 // The lock counter which tells the launcher if the item can be removed from 100 // The lock counter which tells the launcher if the item can be removed from
97 // the launcher (0) or not (>0). It is being used for windowed V1 101 // the launcher (0) or not (>0). It is being used for windowed V1
98 // applications. 102 // applications.
99 int locked_; 103 int locked_;
100 104
101 // Set to true if the launcher item image has been set by the controller. 105 // Set to true if the launcher item image has been set by the controller.
102 bool image_set_by_controller_; 106 bool image_set_by_controller_;
103 107
104 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); 108 DISALLOW_COPY_AND_ASSIGN(LauncherItemController);
105 }; 109 };
106 110
107 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ 111 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698