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

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

Issue 2765563002: Move and rename Chrome's AppLauncherId to ash::AppLaunchId. (Closed)
Patch Set: Add example commment. 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void OnAppUninstalledPrepared(content::BrowserContext* browser_context, 148 void OnAppUninstalledPrepared(content::BrowserContext* browser_context,
149 const std::string& app_id) override; 149 const std::string& app_id) override;
150 150
151 protected: 151 protected:
152 // ChromeLauncherController: 152 // ChromeLauncherController:
153 void OnInit() override; 153 void OnInit() override;
154 154
155 // Creates a new app shortcut item and controller on the shelf at |index|. 155 // Creates a new app shortcut item and controller on the shelf at |index|.
156 // Use kInsertItemAtEnd to add a shortcut as the last item. 156 // Use kInsertItemAtEnd to add a shortcut as the last item.
157 ash::ShelfID CreateAppShortcutLauncherItem( 157 ash::ShelfID CreateAppShortcutLauncherItem(
158 const ash::AppLauncherId& app_launcher_id, 158 const ash::AppLaunchId& app_launch_id,
159 int index); 159 int index);
160 160
161 private: 161 private:
162 friend class ChromeLauncherControllerImplTest; 162 friend class ChromeLauncherControllerImplTest;
163 friend class ShelfAppBrowserTest; 163 friend class ShelfAppBrowserTest;
164 friend class LauncherPlatformAppBrowserTest; 164 friend class LauncherPlatformAppBrowserTest;
165 friend class TestChromeLauncherControllerImpl; 165 friend class TestChromeLauncherControllerImpl;
166 FRIEND_TEST_ALL_PREFIXES(ChromeLauncherControllerImplTest, AppPanels); 166 FRIEND_TEST_ALL_PREFIXES(ChromeLauncherControllerImplTest, AppPanels);
167 167
168 typedef std::map<ash::ShelfID, LauncherItemController*> IDToItemControllerMap; 168 typedef std::map<ash::ShelfID, LauncherItemController*> IDToItemControllerMap;
169 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap; 169 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap;
170 170
171 // Remembers / restores list of running applications. 171 // Remembers / restores list of running applications.
172 // Note that this order will neither be stored in the preference nor will it 172 // Note that this order will neither be stored in the preference nor will it
173 // remember the order of closed applications since it is only temporary. 173 // remember the order of closed applications since it is only temporary.
174 void RememberUnpinnedRunningApplicationOrder(); 174 void RememberUnpinnedRunningApplicationOrder();
175 void RestoreUnpinnedRunningApplicationOrder(const std::string& user_id); 175 void RestoreUnpinnedRunningApplicationOrder(const std::string& user_id);
176 176
177 // Creates a new app shortcut item and controller on the shelf at |index|. 177 // Creates a new app shortcut item and controller on the shelf at |index|.
178 // Use kInsertItemAtEnd to add a shortcut as the last item. 178 // Use kInsertItemAtEnd to add a shortcut as the last item.
179 ash::ShelfID CreateAppShortcutLauncherItemWithType( 179 ash::ShelfID CreateAppShortcutLauncherItemWithType(
180 const ash::AppLauncherId& app_launcher_id, 180 const ash::AppLaunchId& app_launch_id,
181 int index, 181 int index,
182 ash::ShelfItemType shelf_item_type); 182 ash::ShelfItemType shelf_item_type);
183 183
184 // Invoked when the associated browser or app is closed. 184 // Invoked when the associated browser or app is closed.
185 void LauncherItemClosed(ash::ShelfID id); 185 void LauncherItemClosed(ash::ShelfID id);
186 186
187 // Internal helpers for pinning and unpinning that handle both 187 // Internal helpers for pinning and unpinning that handle both
188 // client-triggered and internal pinning operations. 188 // client-triggered and internal pinning operations.
189 void DoPinAppWithID(const std::string& app_id); 189 void DoPinAppWithID(const std::string& app_id);
190 void DoUnpinAppWithID(const std::string& app_id, bool update_prefs); 190 void DoUnpinAppWithID(const std::string& app_id, bool update_prefs);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 typedef std::vector<std::string> RunningAppListIds; 315 typedef std::vector<std::string> RunningAppListIds;
316 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; 316 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap;
317 RunningAppListIdMap last_used_running_application_order_; 317 RunningAppListIdMap last_used_running_application_order_;
318 318
319 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; 319 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_;
320 320
321 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); 321 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl);
322 }; 322 };
323 323
324 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ 324 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698