Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_TAB_HELPER_H_ | |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_TAB_HELPER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 class Profile; | |
| 11 | |
| 12 namespace content { | |
| 13 class WebContents; | |
| 14 } | |
| 15 | |
| 16 // Mockable interface to get app ids from tabs. | |
| 17 class AppTabHelper { | |
|
sky
2016/04/27 21:01:33
I would avoid using the suffix TabHelper. TabHelpe
msw
2016/04/29 22:30:49
This was simply moving the existing class, but I'v
| |
| 18 public: | |
| 19 virtual ~AppTabHelper() {} | |
| 20 | |
| 21 // Returns the app id of the specified tab, or an empty string if there is | |
| 22 // no app. All known profiles will be queried for this. | |
| 23 virtual std::string GetAppID(content::WebContents* tab) = 0; | |
| 24 | |
| 25 // Returns true if |id| is valid for the currently active profile. | |
| 26 // Used during restore to ignore no longer valid extensions. | |
| 27 // Note that already running applications are ignored by the restore process. | |
| 28 virtual bool IsValidIDForCurrentUser(const std::string& id) = 0; | |
| 29 | |
| 30 // Sets the currently active profile for the usage of |GetAppID|. | |
| 31 virtual void SetCurrentUser(Profile* profile) = 0; | |
| 32 }; | |
| 33 | |
| 34 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_TAB_HELPER_H_ | |
| OLD | NEW |