summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
blob: 3abf5dadaf295660c23f05d030192217468ef391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
#define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_

#include <list>
#include <map>
#include <set>
#include <string>
#include <vector>

#include "ash/display/display_controller.h"
#include "ash/launcher/launcher_delegate.h"
#include "ash/launcher/launcher_types.h"
#include "ash/shelf/shelf_item_delegate.h"
#include "ash/shelf/shelf_layout_manager_observer.h"
#include "ash/shelf/shelf_model_observer.h"
#include "ash/shelf/shelf_types.h"
#include "ash/shell_observer.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/prefs/pref_change_registrar.h"
#include "chrome/browser/extensions/app_icon_loader.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/prefs/pref_service_syncable_observer.h"
#include "chrome/browser/ui/ash/app_sync_ui_state_observer.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h"
#include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/aura/window_observer.h"

class AppSyncUIState;
class Browser;
class BrowserShortcutLauncherItemController;
class BrowserStatusMonitor;
class ExtensionEnableFlow;
class GURL;
class LauncherItemController;
class Profile;
class ShellWindowLauncherController;
class TabContents;

namespace ash {
class ShelfItemDelegateManager;
class ShelfModel;
}

namespace aura {
class Window;
}

namespace content {
class WebContents;
}

namespace ui {
class BaseWindow;
}

// A list of the elements which makes up a simple menu description.
typedef ScopedVector<ChromeLauncherAppMenuItem> ChromeLauncherAppMenuItems;

// A class which needs to be overwritten dependent on the used OS to moitor
// user switching.
class ChromeLauncherControllerUserSwitchObserver {
 public:
  ChromeLauncherControllerUserSwitchObserver() {}
  virtual ~ChromeLauncherControllerUserSwitchObserver() {}

 private:

  DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerUserSwitchObserver);
};

// ChromeLauncherController manages the launcher items needed for content
// windows. Launcher items have a type, an optional app id, and a controller.
// This incarnation groups running tabs/windows in application specific lists.
// * Browser app windows have BrowserLauncherItemController, owned by the
//   BrowserView instance.
// * App shell windows have ShellWindowLauncherItemController, owned by
//   ShellWindowLauncherController.
// * Shortcuts have no LauncherItemController.
class ChromeLauncherController : public ash::LauncherDelegate,
                                 public ash::ShelfModelObserver,
                                 public ash::ShellObserver,
                                 public ash::DisplayController::Observer,
                                 public content::NotificationObserver,
                                 public extensions::AppIconLoader::Delegate,
                                 public PrefServiceSyncableObserver,
                                 public AppSyncUIStateObserver,
                                 public ExtensionEnableFlowDelegate,
                                 public ash::ShelfLayoutManagerObserver {
 public:
  // Indicates if a launcher item is incognito or not.
  enum IncognitoState {
    STATE_INCOGNITO,
    STATE_NOT_INCOGNITO,
  };

  // Used to update the state of non plaform apps, as web contents change.
  enum AppState {
    APP_STATE_ACTIVE,
    APP_STATE_WINDOW_ACTIVE,
    APP_STATE_INACTIVE,
    APP_STATE_REMOVED
  };

  // Mockable interface to get app ids from tabs.
  class AppTabHelper {
   public:
    virtual ~AppTabHelper() {}

    // Returns the app id of the specified tab, or an empty string if there is
    // no app. All known profiles will be queried for this.
    virtual std::string GetAppID(content::WebContents* tab) = 0;

    // Returns true if |id| is valid for the currently active profile.
    // Used during restore to ignore no longer valid extensions.
    // Note that already running applications are ignored by the restore
    // process.
    virtual bool IsValidIDForCurrentUser(const std::string& id) = 0;

    // Sets the currently active profile for the usage of |GetAppID|.
    virtual void SetCurrentUser(Profile* profile) = 0;
  };

  ChromeLauncherController(Profile* profile, ash::ShelfModel* model);
  virtual ~ChromeLauncherController();

  // Initializes this ChromeLauncherController.
  void Init();

  // Creates an instance.
  static ChromeLauncherController* CreateInstance(Profile* profile,
                                                  ash::ShelfModel* model);

  // Returns the single ChromeLauncherController instance.
  static ChromeLauncherController* instance() { return instance_; }

  // Creates a new app item on the launcher for |controller|.
  ash::LauncherID CreateAppLauncherItem(LauncherItemController* controller,
                                        const std::string& app_id,
                                        ash::LauncherItemStatus status);

  // Updates the running status of an item. It will also update the status of
  // browsers launcher item if needed.
  void SetItemStatus(ash::LauncherID id, ash::LauncherItemStatus status);

  // Updates the controller associated with id (which should be a shortcut).
  // |controller| remains owned by caller.
  void SetItemController(ash::LauncherID id,
                         LauncherItemController* controller);

  // Closes or unpins the launcher item.
  void CloseLauncherItem(ash::LauncherID id);

  // Pins the specified id. Currently only supports platform apps.
  void Pin(ash::LauncherID id);

  // Unpins the specified id, closing if not running.
  void Unpin(ash::LauncherID id);

  // Returns true if the item identified by |id| is pinned.
  bool IsPinned(ash::LauncherID id);

  // Pins/unpins the specified id.
  void TogglePinned(ash::LauncherID id);

  // Returns true if the specified item can be pinned or unpinned. Only apps can
  // be pinned.
  bool IsPinnable(ash::LauncherID id) const;

  // If there is no launcher item in the launcher for application |app_id|, one
  // gets created. The (existing or created) launcher items get then locked
  // against a users un-pinning removal.
  void LockV1AppWithID(const std::string& app_id);

  // A previously locked launcher item of type |app_id| gets unlocked. If the
  // lock count reaches 0 and the item is not pinned it will go away.
  void UnlockV1AppWithID(const std::string& app_id);

  // Requests that the launcher item controller specified by |id| open a new
  // instance of the app.  |event_flags| holds the flags of the event which
  // triggered this command.
  void Launch(ash::LauncherID id, int event_flags);

  // Closes the specified item.
  void Close(ash::LauncherID id);

  // Returns true if the specified item is open.
  bool IsOpen(ash::LauncherID id);

  // Returns true if the specified item is for a platform app.
  bool IsPlatformApp(ash::LauncherID id);

  // Opens a new instance of the application identified by |app_id|.
  // Used by the app-list, and by pinned-app launcher items.
  void LaunchApp(const std::string& app_id,
                 ash::LaunchSource source,
                 int event_flags);

  // If |app_id| is running, reactivates the app's most recently active window,
  // otherwise launches and activates the app.
  // Used by the app-list, and by pinned-app launcher items.
  void ActivateApp(const std::string& app_id,
                   ash::LaunchSource source,
                   int event_flags);

  // Returns the launch type of app for the specified id.
  extensions::LaunchType GetLaunchType(ash::LauncherID id);

  // Set the image for a specific launcher item (e.g. when set by the app).
  void SetLauncherItemImage(ash::LauncherID launcher_id,
                            const gfx::ImageSkia& image);

  // Find out if the given application |id| is a windowed app item and not a
  // pinned item in the launcher.
  bool IsWindowedAppInLauncher(const std::string& app_id);

  // Updates the launch type of the app for the specified id to |launch_type|.
  void SetLaunchType(ash::LauncherID id,
                     extensions::LaunchType launch_type);

  // Returns true if the user is currently logged in as a guest.
  // Makes virtual for unittest in LauncherContextMenuTest.
  virtual bool IsLoggedInAsGuest();

  // Invoked when user clicks on button in the launcher and there is no last
  // used window (or CTRL is held with the click).
  void CreateNewWindow();

  // Invoked when the user clicks on button in the launcher to create a new
  // incognito window.
  void CreateNewIncognitoWindow();

  // Updates the pinned pref state. The pinned state consists of a list pref.
  // Each item of the list is a dictionary. The key |kAppIDPath| gives the
  // id of the app.
  void PersistPinnedState();

  ash::ShelfModel* model();

  // Accessor to the currently loaded profile. Note that in multi profile use
  // cases this might change over time.
  Profile* profile();

  // Gets the shelf auto-hide behavior on |root_window|.
  ash::ShelfAutoHideBehavior GetShelfAutoHideBehavior(
      aura::Window* root_window) const;

  // Returns |true| if the user is allowed to modify the shelf auto-hide
  // behavior on |root_window|.
  bool CanUserModifyShelfAutoHideBehavior(aura::Window* root_window) const;

  // Toggles the shelf auto-hide behavior on |root_window|. Does nothing if the
  // user is not allowed to modify the auto-hide behavior.
  void ToggleShelfAutoHideBehavior(aura::Window* root_window);

  // The tab no longer represents its previously identified application.
  void RemoveTabFromRunningApp(content::WebContents* tab,
                               const std::string& app_id);

  // Notify the controller that the state of an non platform app's tabs
  // have changed,
  void UpdateAppState(content::WebContents* contents, AppState app_state);

  // Returns LauncherID for |contents|. If |contents| is not an app or is not
  // pinned, returns the id of browser shrotcut.
  ash::LauncherID GetLauncherIDForWebContents(content::WebContents* contents);

  // Limits application refocusing to urls that match |url| for |id|.
  void SetRefocusURLPatternForTest(ash::LauncherID id, const GURL& url);

  // Returns the extension identified by |app_id|.
  const extensions::Extension* GetExtensionForAppID(
      const std::string& app_id) const;

  // Activates a |window|. If |allow_minimize| is true and the system allows
  // it, the the window will get minimized instead.
  void ActivateWindowOrMinimizeIfActive(ui::BaseWindow* window,
                                        bool allow_minimize);

  // ash::LauncherDelegate overrides:
  virtual void OnLauncherCreated(ash::Launcher* launcher) OVERRIDE;
  virtual void OnLauncherDestroyed(ash::Launcher* launcher) OVERRIDE;
  virtual ash::LauncherID GetLauncherIDForAppID(
      const std::string& app_id) OVERRIDE;
  virtual const std::string& GetAppIDForLauncherID(ash::LauncherID id) OVERRIDE;
  virtual void PinAppWithID(const std::string& app_id) OVERRIDE;
  virtual bool IsAppPinned(const std::string& app_id) OVERRIDE;
  virtual bool CanPin() const OVERRIDE;
  virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE;

  // ash::ShelfModelObserver overrides:
  virtual void ShelfItemAdded(int index) OVERRIDE;
  virtual void ShelfItemRemoved(int index, ash::LauncherID id) OVERRIDE;
  virtual void ShelfItemMoved(int start_index, int target_index) OVERRIDE;
  virtual void ShelfItemChanged(int index,
                                const ash::LauncherItem& old_item) OVERRIDE;
  virtual void ShelfStatusChanged() OVERRIDE;

  // content::NotificationObserver overrides:
  virtual void Observe(int type,
                       const content::NotificationSource& source,
                       const content::NotificationDetails& details) OVERRIDE;

  // ash::ShellObserver overrides:
  virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE;

  // ash::DisplayController::Observer overrides:
  virtual void OnDisplayConfigurationChanging() OVERRIDE;
  virtual void OnDisplayConfigurationChanged() OVERRIDE;

  // PrefServiceSyncableObserver overrides:
  virtual void OnIsSyncingChanged() OVERRIDE;

  // AppSyncUIStateObserver overrides:
  virtual void OnAppSyncUIStatusChanged() OVERRIDE;

  // ExtensionEnableFlowDelegate overrides:
  virtual void ExtensionEnableFlowFinished() OVERRIDE;
  virtual void ExtensionEnableFlowAborted(bool user_initiated) OVERRIDE;

  // extensions::AppIconLoader overrides:
  virtual void SetAppImage(const std::string& app_id,
                           const gfx::ImageSkia& image) OVERRIDE;

  // ash::ShelfLayoutManagerObserver overrides:
  virtual void OnAutoHideBehaviorChanged(
      aura::Window* root_window,
      ash::ShelfAutoHideBehavior new_behavior) OVERRIDE;

  // Called when the active user has changed.
  void ActiveUserChanged(const std::string& user_email);

  // Called when a user got added to the session.
  void AdditionalUserAddedToSession(Profile* profile);

  // Get the list of all running incarnations of this item.
  // |event_flags| specifies the flags which were set by the event which
  // triggered this menu generation. It can be used to generate different lists.
  ChromeLauncherAppMenuItems GetApplicationList(const ash::LauncherItem& item,
                                                int event_flags);

  // Get the list of all tabs which belong to a certain application type.
  std::vector<content::WebContents*> GetV1ApplicationsFromAppId(
      std::string app_id);

  // Activates a specified shell application.
  void ActivateShellApp(const std::string& app_id, int index);

  // Checks if a given |web_contents| is known to be associated with an
  // application of type |app_id|.
  bool IsWebContentHandledByApplication(content::WebContents* web_contents,
                                        const std::string& app_id);

  // Check if the gMail app is loaded and it can handle the given web content.
  // This special treatment is required to address crbug.com/234268.
  bool ContentCanBeHandledByGmailApp(content::WebContents* web_contents);

  // Get the favicon for the application list entry for |web_contents|.
  // Note that for incognito windows the incognito icon will be returned.
  // If |web_contents| has not loaded, returns the default favicon.
  gfx::Image GetAppListIcon(content::WebContents* web_contents) const;

  // Get the title for the applicatoin list entry for |web_contents|.
  // If |web_contents| has not loaded, returns "Net Tab".
  string16 GetAppListTitle(content::WebContents* web_contents) const;

  // Returns the LauncherItemController of BrowserShortcut.
  BrowserShortcutLauncherItemController*
      GetBrowserShortcutLauncherItemController();

  LauncherItemController* GetLauncherItemController(const ash::LauncherID id);

  // Returns true if |browser| is owned by the active user.
  bool IsBrowserFromActiveUser(Browser* browser);

  // Access to the BrowserStatusMonitor for tests.
  BrowserStatusMonitor* browser_status_monitor_for_test() {
    return browser_status_monitor_.get();
  }

  // Access to the ShellWindowController for tests.
  ShellWindowLauncherController* shell_window_controller_for_test() {
    return shell_window_controller_.get();
  }

 protected:
  // Creates a new app shortcut item and controller on the launcher at |index|.
  // Use kInsertItemAtEnd to add a shortcut as the last item.
  ash::LauncherID CreateAppShortcutLauncherItem(const std::string& app_id,
                                                int index);

  // Sets the AppTabHelper/AppIconLoader, taking ownership of the helper class.
  // These are intended for testing.
  void SetAppTabHelperForTest(AppTabHelper* helper);
  void SetAppIconLoaderForTest(extensions::AppIconLoader* loader);
  const std::string& GetAppIdFromLauncherIdForTest(ash::LauncherID id);

  // Sets the ash::ShelfItemDelegateManager only for unittests and doesn't
  // take an ownership of it.
  void SetShelfItemDelegateManagerForTest(
      ash::ShelfItemDelegateManager* manager);

 private:
  friend class ChromeLauncherControllerTest;
  friend class LauncherAppBrowserTest;
  friend class LauncherPlatformAppBrowserTest;

  typedef std::map<ash::LauncherID, LauncherItemController*>
          IDToItemControllerMap;
  typedef std::list<content::WebContents*> WebContentsList;
  typedef std::map<std::string, WebContentsList> AppIDToWebContentsListMap;
  typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap;

  // Creates a new app shortcut item and controller on the launcher at |index|.
  // Use kInsertItemAtEnd to add a shortcut as the last item.
  ash::LauncherID CreateAppShortcutLauncherItemWithType(
      const std::string& app_id,
      int index,
      ash::LauncherItemType launcher_item_type);

  // Returns the profile used for new windows.
  Profile* GetProfileForNewWindows();

  // Invoked when the associated browser or app is closed.
  void LauncherItemClosed(ash::LauncherID id);

  // Internal helpers for pinning and unpinning that handle both
  // client-triggered and internal pinning operations.
  void DoPinAppWithID(const std::string& app_id);
  void DoUnpinAppWithID(const std::string& app_id);

  // Pin a running app with |launcher_id| internally to |index|. It returns
  // the index where the item was pinned.
  int PinRunningAppInternal(int index, ash::LauncherID launcher_id);

  // Unpin a locked application. This is an internal call which converts the
  // model type of the given app index from a shortcut into an unpinned running
  // app.
  void UnpinRunningAppInternal(int index);

  // Re-syncs launcher model with prefs::kPinnedLauncherApps.
  void UpdateAppLaunchersFromPref();

  // Persists the shelf auto-hide behavior to prefs.
  void SetShelfAutoHideBehaviorPrefs(ash::ShelfAutoHideBehavior behavior,
                                     aura::Window* root_window);

  // Sets the shelf auto-hide behavior from prefs.
  void SetShelfAutoHideBehaviorFromPrefs();

  // Sets the shelf alignment from prefs.
  void SetShelfAlignmentFromPrefs();

  // Sets both of auto-hide behavior and alignment from prefs.
  void SetShelfBehaviorsFromPrefs();

  // Returns the most recently active web contents for an app.
  content::WebContents* GetLastActiveWebContents(const std::string& app_id);

  // Creates an app launcher to insert at |index|. Note that |index| may be
  // adjusted by the model to meet ordering constraints.
  // The |launcher_item_type| will be set into the ShelfModel.
  ash::LauncherID InsertAppLauncherItem(
      LauncherItemController* controller,
      const std::string& app_id,
      ash::LauncherItemStatus status,
      int index,
      ash::LauncherItemType launcher_item_type);

  bool HasItemController(ash::LauncherID id) const;

  // Enumerate all Web contents which match a given shortcut |controller|.
  std::vector<content::WebContents*> GetV1ApplicationsFromController(
      LauncherItemController* controller);

  // Create LauncherItem for Browser Shortcut.
  ash::LauncherID CreateBrowserShortcutLauncherItem();

  // Check if the given |web_contents| is in incognito mode.
  bool IsIncognito(const content::WebContents* web_contents) const;

  // Update browser shortcut's index.
  void PersistChromeItemIndex(int index);

  // Get browser shortcut's index from pref.
  int GetChromeIconIndexFromPref() const;

  // Depending on the provided flags, move either the chrome icon, the app icon
  // or none to the given |target_index|. The provided |chrome_index| and
  // |app_list_index| locations will get adjusted within this call to finalize
  // the action and to make sure that the other item can still be moved
  // afterwards (index adjustments).
  void MoveChromeOrApplistToFinalPosition(
      bool is_chrome,
      bool is_app_list,
      int target_index,
      int* chrome_index,
      int* app_list_index);

  // Finds the index of where to insert the next item.
  int FindInsertionPoint(bool is_app_list);

  // Get the browser shortcut's index in the shelf using the current's systems
  // configuration of pinned and known (but not running) apps.
  int GetChromeIconIndexForCreation();

  // Get the list of pinned programs from the preferences.
  std::vector<std::string> GetListOfPinnedAppsAndBrowser();

  // Close all windowed V1 applications of a certain extension which was already
  // deleted.
  void CloseWindowedAppsFromRemovedExtension(const std::string& app_id);

  // Set ShelfItemDelegate |item_delegate| for |id| and take an ownership.
  // TODO(simon.hong81): Make this take a scoped_ptr of |item_delegate|.
  void SetShelfItemDelegate(ash::LauncherID id,
                            ash::ShelfItemDelegate* item_delegate);

  // Attach to a specific profile.
  void AttachProfile(Profile* proifile);

  // Forget the current profile to allow attaching to a new one.
  void ReleaseProfile();

  // Returns true if |app_id| is a Packaged App that has already launched on the
  // native desktop and, if so, executes it as a desktop shortcut to activate
  // desktop mode and send another OnLaunched event to the Extension.
  bool LaunchedInNativeDesktop(const std::string& app_id);

  static ChromeLauncherController* instance_;

  ash::ShelfModel* model_;

  ash::ShelfItemDelegateManager* item_delegate_manager_;

  // Profile used for prefs and loading extensions. This is NOT necessarily the
  // profile new windows are created with.
  Profile* profile_;

  IDToItemControllerMap id_to_item_controller_map_;

  // Maintains activation order of web contents for each app.
  AppIDToWebContentsListMap app_id_to_web_contents_list_;

  // Direct access to app_id for a web contents.
  WebContentsToAppIDMap web_contents_to_app_id_;

  // Used to track shell windows.
  scoped_ptr<ShellWindowLauncherController> shell_window_controller_;

  // Used to get app info for tabs.
  scoped_ptr<AppTabHelper> app_tab_helper_;

  // Used to load the image for an app item.
  scoped_ptr<extensions::AppIconLoader> app_icon_loader_;

  content::NotificationRegistrar notification_registrar_;

  PrefChangeRegistrar pref_change_registrar_;

  AppSyncUIState* app_sync_ui_state_;

  scoped_ptr<ExtensionEnableFlow> extension_enable_flow_;

  // Launchers that are currently being observed.
  std::set<ash::Launcher*> launchers_;

  // The owned browser status monitor.
  scoped_ptr<BrowserStatusMonitor> browser_status_monitor_;

  // A special observer class to detect user switches.
  scoped_ptr<ChromeLauncherControllerUserSwitchObserver> user_switch_observer_;

  // If true, incoming pinned state changes should be ignored.
  bool ignore_persist_pinned_state_change_;

  // True if each user has an own desktop.
  bool multi_profile_desktop_separation_;

  DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController);
};

#endif  // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_