summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_app_launcher.h
blob: f1a5a0106f1563ea4c4272ff9a77bfc59d7969d3 (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) 2006-2008 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_WEB_APP_LAUNCHER_H__
#define CHROME_BROWSER_WEB_APP_LAUNCHER_H__

#include "chrome/browser/gears_integration.h"
#include "googleurl/src/gurl.h"

class Profile;

// WebAppLauncher is used during startup to launch a web app (aka an installed
// app).
class WebAppLauncher {
 public:
  // Queries Gears for the name of the app, and when Gears callsback with the
  // response creates a WebApp and Browser.
  static void Launch(Profile* profile, const GURL& url, int show_command);

 private:
  WebAppLauncher(Profile* profile, const GURL& url, int show_command);

  // Invoked from the Launch method. Queries Gears for the apps. Gears callback
  // to OnGotApps.
  void Run();

  // Callback from Gears when list of apps is available. Creates WebApp and
  // Browser.
  void OnGotApps(GearsShortcutList* apps);

  Profile* profile_;

  // URL of the app.
  const GURL url_;

  // How to show the app.
  const int show_command_;

  DISALLOW_EVIL_CONSTRUCTORS(WebAppLauncher);
};

#endif  // CHROME_BROWSER_WEB_APP_LAUNCHER_H__