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

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

Issue 2553673003: [Merge to M55] Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_ARC_APP_DEFERRED_LAUNCHER_ITEM_CONTROLLER _H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_DEFERRED_LAUNCHER_ITEM_CONTROLLER _H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_DEFERRED_LAUNCHER_ITEM_CONTROLLER _H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_DEFERRED_LAUNCHER_ITEM_CONTROLLER _H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" 13 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
14 14
15 class ArcAppDeferredLauncherController; 15 class ArcAppDeferredLauncherController;
16 class ChromeLauncherController; 16 class ChromeLauncherController;
17 17
18 // ArcAppDeferredLauncherItemController displays the icon of the ARC app that
19 // cannot be launched immediately (due to ARC not being ready) on Chrome OS'
20 // shelf, with an overlaid spinner to provide visual feedback.
18 class ArcAppDeferredLauncherItemController : public LauncherItemController { 21 class ArcAppDeferredLauncherItemController : public LauncherItemController {
19 public: 22 public:
20 ArcAppDeferredLauncherItemController( 23 ArcAppDeferredLauncherItemController(
21 const std::string& arc_app_id, 24 const std::string& arc_app_id,
22 ChromeLauncherController* controller, 25 ChromeLauncherController* controller,
26 int event_flags,
23 const base::WeakPtr<ArcAppDeferredLauncherController>& host); 27 const base::WeakPtr<ArcAppDeferredLauncherController>& host);
24 28
25 ~ArcAppDeferredLauncherItemController() override; 29 ~ArcAppDeferredLauncherItemController() override;
26 30
27 base::TimeDelta GetActiveTime() const; 31 base::TimeDelta GetActiveTime() const;
28 32
33 int event_flags() const { return event_flags_; }
34
29 // ash::ShelfItemDelegate 35 // ash::ShelfItemDelegate
30 ash::ShelfItemDelegate::PerformedAction ItemSelected( 36 ash::ShelfItemDelegate::PerformedAction ItemSelected(
31 const ui::Event& event) override; 37 const ui::Event& event) override;
32 base::string16 GetTitle() override; 38 base::string16 GetTitle() override;
33 bool CanPin() const override; 39 bool CanPin() const override;
34 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override; 40 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override;
35 bool IsDraggable() override; 41 bool IsDraggable() override;
36 bool ShouldShowTooltip() override; 42 bool ShouldShowTooltip() override;
37 void Close() override; 43 void Close() override;
38 44
39 // LauncherItemController overrides: 45 // LauncherItemController overrides:
40 bool IsOpen() const override; 46 bool IsOpen() const override;
41 bool IsVisible() const override; 47 bool IsVisible() const override;
42 void Launch(ash::LaunchSource source, int event_flags) override; 48 void Launch(ash::LaunchSource source, int event_flags) override;
43 ash::ShelfItemDelegate::PerformedAction Activate( 49 ash::ShelfItemDelegate::PerformedAction Activate(
44 ash::LaunchSource source) override; 50 ash::LaunchSource source) override;
45 ChromeLauncherAppMenuItems GetApplicationList(int event_flags) override; 51 ChromeLauncherAppMenuItems GetApplicationList(int event_flags) override;
46 52
47 private: 53 private:
54 // The flags of the event that caused the ARC app to be activated. These will
55 // be propagated to the launch event once the app is actually launched.
56 const int event_flags_;
57
48 base::WeakPtr<ArcAppDeferredLauncherController> host_; 58 base::WeakPtr<ArcAppDeferredLauncherController> host_;
49 const base::Time start_time_; 59 const base::Time start_time_;
50 60
51 DISALLOW_COPY_AND_ASSIGN(ArcAppDeferredLauncherItemController); 61 DISALLOW_COPY_AND_ASSIGN(ArcAppDeferredLauncherItemController);
52 }; 62 };
53 63
54 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_DEFERRED_LAUNCHER_ITEM_CONTROL LER_H_ 64 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_DEFERRED_LAUNCHER_ITEM_CONTROL LER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698