OLD | NEW |
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_CONTROLLER_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTROLLER_HELPER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTROLLER_HELPER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTROLLER_HELPER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "ash/public/cpp/app_launch_id.h" | |
12 #include "ash/public/cpp/shelf_types.h" | 11 #include "ash/public/cpp/shelf_types.h" |
13 #include "base/macros.h" | 12 #include "base/macros.h" |
14 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
15 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 14 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
16 | 15 |
17 class ArcAppListPrefs; | 16 class ArcAppListPrefs; |
18 class ExtensionEnableFlow; | 17 class ExtensionEnableFlow; |
19 class Profile; | 18 class Profile; |
20 | 19 |
21 namespace content { | 20 namespace content { |
(...skipping 13 matching lines...) Expand all Loading... |
35 | 34 |
36 // Returns the app id of the specified tab, or an empty string if there is | 35 // Returns the app id of the specified tab, or an empty string if there is |
37 // no app. All known profiles will be queried for this. | 36 // no app. All known profiles will be queried for this. |
38 virtual std::string GetAppID(content::WebContents* tab); | 37 virtual std::string GetAppID(content::WebContents* tab); |
39 | 38 |
40 // Returns true if |id| is valid for the currently active profile. | 39 // Returns true if |id| is valid for the currently active profile. |
41 // Used during restore to ignore no longer valid extensions. | 40 // Used during restore to ignore no longer valid extensions. |
42 // Note that already running applications are ignored by the restore process. | 41 // Note that already running applications are ignored by the restore process. |
43 virtual bool IsValidIDForCurrentUser(const std::string& id) const; | 42 virtual bool IsValidIDForCurrentUser(const std::string& id) const; |
44 | 43 |
45 void LaunchApp(ash::AppLaunchId id, | 44 void LaunchApp(const ash::ShelfID& id, |
46 ash::ShelfLaunchSource source, | 45 ash::ShelfLaunchSource source, |
47 int event_flags); | 46 int event_flags); |
48 | 47 |
49 virtual ArcAppListPrefs* GetArcAppListPrefs() const; | 48 virtual ArcAppListPrefs* GetArcAppListPrefs() const; |
50 | 49 |
51 Profile* profile() { return profile_; } | 50 Profile* profile() { return profile_; } |
52 const Profile* profile() const { return profile_; } | 51 const Profile* profile() const { return profile_; } |
53 void set_profile(Profile* profile) { profile_ = profile; } | 52 void set_profile(Profile* profile) { profile_ = profile; } |
54 | 53 |
55 private: | 54 private: |
56 // ExtensionEnableFlowDelegate: | 55 // ExtensionEnableFlowDelegate: |
57 void ExtensionEnableFlowFinished() override; | 56 void ExtensionEnableFlowFinished() override; |
58 void ExtensionEnableFlowAborted(bool user_initiated) override; | 57 void ExtensionEnableFlowAborted(bool user_initiated) override; |
59 | 58 |
60 // The currently active profile for the usage of |GetAppID|. | 59 // The currently active profile for the usage of |GetAppID|. |
61 Profile* profile_; | 60 Profile* profile_; |
62 std::unique_ptr<ExtensionEnableFlow> extension_enable_flow_; | 61 std::unique_ptr<ExtensionEnableFlow> extension_enable_flow_; |
63 | 62 |
64 DISALLOW_COPY_AND_ASSIGN(LauncherControllerHelper); | 63 DISALLOW_COPY_AND_ASSIGN(LauncherControllerHelper); |
65 }; | 64 }; |
66 | 65 |
67 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTROLLER_HELPER_H_ | 66 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTROLLER_HELPER_H_ |
OLD | NEW |