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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_H_
6 #define CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_H_
10 #include "base/callback.h"
11 #include "chrome/browser/shell_integration.h"
17 namespace extensions
{
25 typedef base::Callback
<void(const ShellIntegration::ShortcutInfo
&)>
28 ShellIntegration::ShortcutInfo
ShortcutInfoForExtensionAndProfile(
29 const extensions::Extension
* extension
, Profile
* profile
);
31 // Extracts shortcut info of the given WebContents.
32 void GetShortcutInfoForTab(content::WebContents
* web_contents
,
33 ShellIntegration::ShortcutInfo
* info
);
35 // Updates web app shortcut of the WebContents. This function checks and
36 // updates web app icon and shortcuts if needed. For icon, the check is based
37 // on MD5 hash of icon image. For shortcuts, it checks the desktop, start menu
38 // and quick launch (as well as pinned shortcut) for shortcut and only
39 // updates (recreates) them if they exits.
40 void UpdateShortcutForTabContents(content::WebContents
* web_contents
);
42 // Updates the shortcut info for |extension| and |profile|.
43 void UpdateShortcutInfoForApp(const extensions::Extension
& extension
,
45 ShellIntegration::ShortcutInfo
* shortcut_info
);
47 // Fetches the icon for |extension| and calls |callback| with shortcut info
48 // filled out as by UpdateShortcutInfoForApp.
49 void UpdateShortcutInfoAndIconForApp(
50 const extensions::Extension
& extension
,
52 const ShortcutInfoCallback
& callback
);
54 } // namespace web_app
56 #endif // CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_H_