summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/web_applications/web_app_ui.h
blob: 627ab9e7d365e9fd004c092767da691c9c34130e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2012 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_WEB_APPLICATIONS_WEB_APP_UI_H_
#define CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_H_

#include <vector>

#include "chrome/browser/shell_integration.h"

namespace content {
class WebContents;
}

namespace extensions {
class Extension;
}

class Profile;

namespace web_app {

// Extracts shortcut info of the given WebContents.
void GetShortcutInfoForTab(content::WebContents* web_contents,
                           ShellIntegration::ShortcutInfo* info);

// Updates web app shortcut of the WebContents. This function checks and
// updates web app icon and shortcuts if needed. For icon, the check is based
// on MD5 hash of icon image. For shortcuts, it checks the desktop, start menu
// and quick launch (as well as pinned shortcut) for shortcut and only
// updates (recreates) them if they exits.
void UpdateShortcutForTabContents(content::WebContents* web_contents);

// Updates the shortcut info for |extension| and |profile|.
// TODO(benwells): make this download the icon as well to remove boilerplate
// code from call sites.
void UpdateShortcutInfoForApp(const extensions::Extension& extension,
                              Profile* profile,
                              ShellIntegration::ShortcutInfo* shortcut_info);

}  // namespace web_app

#endif  // CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_UI_H_