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

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

Issue 2484413002: Enhance chrome.app.window API with title property
Patch Set: Created 4 years, 1 month 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 25 matching lines...) Expand all
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 const std::string& launch_id,
46 const std::string& title,
stevenjb 2016/11/09 18:42:15 Adding 'launch_id' to the constructor made sense b
Andra Paraschiv 2016/11/10 07:53:43 Ok, thank you for this. I will try to modify this
46 ChromeLauncherController* launcher_controller); 47 ChromeLauncherController* launcher_controller);
47 ~LauncherItemController() override; 48 ~LauncherItemController() override;
48 49
49 Type type() const { return type_; } 50 Type type() const { return type_; }
50 ash::ShelfID shelf_id() const { return shelf_id_; } 51 ash::ShelfID shelf_id() const { return shelf_id_; }
51 void set_shelf_id(ash::ShelfID id) { shelf_id_ = id; } 52 void set_shelf_id(ash::ShelfID id) { shelf_id_ = id; }
52 const std::string& app_id() const { return app_id_; } 53 const std::string& app_id() const { return app_id_; }
53 const std::string& launch_id() const { return launch_id_; } 54 const std::string& launch_id() const { return launch_id_; }
55 const std::string& title() const { return title_; }
54 ChromeLauncherController* launcher_controller() const { 56 ChromeLauncherController* launcher_controller() const {
55 return launcher_controller_; 57 return launcher_controller_;
56 } 58 }
57 59
58 // Lock this item to the launcher without being pinned (windowed v1 apps). 60 // Lock this item to the launcher without being pinned (windowed v1 apps).
59 void lock() { locked_++; } 61 void lock() { locked_++; }
60 void unlock() { 62 void unlock() {
61 DCHECK(locked_); 63 DCHECK(locked_);
62 locked_--; 64 locked_--;
63 } 65 }
(...skipping 25 matching lines...) Expand all
89 ash::ShelfItemType GetShelfItemType() const; 91 ash::ShelfItemType GetShelfItemType() const;
90 92
91 private: 93 private:
92 const Type type_; 94 const Type type_;
93 // App id will be empty if there is no app associated with the window. 95 // App id will be empty if there is no app associated with the window.
94 const std::string app_id_; 96 const std::string app_id_;
95 // An id that can be passed to an app when launched in order to support 97 // An id that can be passed to an app when launched in order to support
96 // multiple shelf items per app. This id is used together with the app_id to 98 // multiple shelf items per app. This id is used together with the app_id to
97 // uniquely identify each shelf item that has the same app_id. 99 // uniquely identify each shelf item that has the same app_id.
98 const std::string launch_id_; 100 const std::string launch_id_;
101 // Title of the window that has its own icon in the shelf.
102 const std::string title_;
99 // A unique id assigned by the shelf model for the shelf item. 103 // A unique id assigned by the shelf model for the shelf item.
100 ash::ShelfID shelf_id_; 104 ash::ShelfID shelf_id_;
101 ChromeLauncherController* launcher_controller_; 105 ChromeLauncherController* launcher_controller_;
102 106
103 // The lock counter which tells the launcher if the item can be removed from 107 // The lock counter which tells the launcher if the item can be removed from
104 // the launcher (0) or not (>0). It is being used for windowed V1 108 // the launcher (0) or not (>0). It is being used for windowed V1
105 // applications. 109 // applications.
106 int locked_; 110 int locked_;
107 111
108 // Set to true if the launcher item image has been set by the controller. 112 // Set to true if the launcher item image has been set by the controller.
109 bool image_set_by_controller_; 113 bool image_set_by_controller_;
110 114
111 DISALLOW_COPY_AND_ASSIGN(LauncherItemController); 115 DISALLOW_COPY_AND_ASSIGN(LauncherItemController);
112 }; 116 };
113 117
114 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_ 118 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698