Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / web_applications / web_app_ui.h
blob19ee0cedc283c0964c31da2f7759a8bd06e383f5
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_
8 #include <vector>
10 #include "base/callback.h"
11 #include "chrome/browser/shell_integration.h"
13 namespace content {
14 class WebContents;
17 namespace extensions {
18 class Extension;
21 class Profile;
23 namespace web_app {
25 typedef base::Callback<void(const ShellIntegration::ShortcutInfo&)>
26 ShortcutInfoCallback;
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,
44 Profile* profile,
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,
51 Profile* profile,
52 const ShortcutInfoCallback& callback);
54 } // namespace web_app
56 #endif // CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_H_