Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/app_tab_helper.h |
| diff --git a/chrome/browser/ui/ash/launcher/app_tab_helper.h b/chrome/browser/ui/ash/launcher/app_tab_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1c8015998ac2829309d87e4ca27292f66cc4b40d |
| --- /dev/null |
| +++ b/chrome/browser/ui/ash/launcher/app_tab_helper.h |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2016 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_APP_TAB_HELPER_H_ |
| +#define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_TAB_HELPER_H_ |
| + |
| +#include <string> |
| + |
| +class Profile; |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +// Mockable interface to get app ids from tabs. |
| +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
|
| + 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; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_TAB_HELPER_H_ |