HostedApp: Encapsulate the Extension object in extensions::TabHelper.
Extensions shouldn't leak into chrome/browser/ui/ code.
Use TabHelper::GetAppId instead of Extension*
Since we are going to use std::string for AppId,
this change will allow us to use an abstract apps::App
and move off the Extensions System in the future.
Drive By: Erase unused TabHelper::web_app_info().
Bug: 774918
Change-Id: I3596bb80729c53f53215325abd371dda8a06a50a
Reviewed-on: https://chromium-review.googlesource.com/1229719
Commit-Queue: Alexey Baskakov <[email protected]>
Reviewed-by: Chris Hamilton <[email protected]>
Reviewed-by: Trent Apted <[email protected]>
Reviewed-by: Ben Wells <[email protected]>
Cr-Commit-Position: refs/heads/master@{#592308}
diff --git a/chrome/browser/extensions/tab_helper.h b/chrome/browser/extensions/tab_helper.h
index 6fbeba6..9dd5aee 100644
--- a/chrome/browser/extensions/tab_helper.h
+++ b/chrome/browser/extensions/tab_helper.h
@@ -75,11 +75,12 @@
// specified id.
void SetExtensionAppById(const ExtensionId& extension_app_id);
- const Extension* extension_app() const { return extension_app_; }
- bool is_app() const { return extension_app_ != NULL; }
- const WebApplicationInfo& web_app_info() const {
- return web_app_info_;
- }
+ // Returns true if an app extension has been set.
+ bool is_app() const { return extension_app_ != nullptr; }
+
+ // Return ExtensionId for extension app.
+ // If an app extension has not been set, returns empty id.
+ ExtensionId GetAppId() const;
// If an app extension has been explicitly set for this WebContents its icon
// is returned.