| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_WEB_APP_LAUNCHER_H__ | 5 #ifndef CHROME_BROWSER_WEB_APP_LAUNCHER_H__ |
| 6 #define CHROME_BROWSER_WEB_APP_LAUNCHER_H__ | 6 #define CHROME_BROWSER_WEB_APP_LAUNCHER_H__ |
| 7 | 7 |
| 8 #include "chrome/browser/gears_integration.h" | 8 #include "chrome/browser/gears_integration.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 | 10 |
| 11 class Profile; | 11 class Profile; |
| 12 | 12 |
| 13 // WebAppLauncher is used during startup to launch a web app (aka an installed | 13 // WebAppLauncher is used during startup to launch a web app (aka an installed |
| 14 // app). | 14 // app). |
| 15 class WebAppLauncher { | 15 class WebAppLauncher { |
| 16 public: | 16 public: |
| 17 // Queries Gears for the name of the app, and when Gears callsback with the | 17 // Queries Gears for the name of the app, and when Gears callsback with the |
| 18 // response creates a WebApp and Browser. | 18 // response creates a WebApp and Browser. |
| 19 static void Launch(Profile* profile, const GURL& url, int show_command); | 19 static void Launch(Profile* profile, const GURL& url); |
| 20 | 20 |
| 21 private: | 21 private: |
| 22 WebAppLauncher(Profile* profile, const GURL& url, int show_command); | 22 WebAppLauncher(Profile* profile, const GURL& url); |
| 23 | 23 |
| 24 // Invoked from the Launch method. Queries Gears for the apps. Gears callback | 24 // Invoked from the Launch method. Queries Gears for the apps. Gears callback |
| 25 // to OnGotApps. | 25 // to OnGotApps. |
| 26 void Run(); | 26 void Run(); |
| 27 | 27 |
| 28 // Callback from Gears when list of apps is available. Creates WebApp and | 28 // Callback from Gears when list of apps is available. Creates WebApp and |
| 29 // Browser. | 29 // Browser. |
| 30 void OnGotApps(GearsShortcutList* apps); | 30 void OnGotApps(GearsShortcutList* apps); |
| 31 | 31 |
| 32 Profile* profile_; | 32 Profile* profile_; |
| 33 | 33 |
| 34 // URL of the app. | 34 // URL of the app. |
| 35 const GURL url_; | 35 const GURL url_; |
| 36 | 36 |
| 37 // How to show the app. | |
| 38 const int show_command_; | |
| 39 | |
| 40 DISALLOW_EVIL_CONSTRUCTORS(WebAppLauncher); | 37 DISALLOW_EVIL_CONSTRUCTORS(WebAppLauncher); |
| 41 }; | 38 }; |
| 42 | 39 |
| 43 #endif // CHROME_BROWSER_WEB_APP_LAUNCHER_H__ | 40 #endif // CHROME_BROWSER_WEB_APP_LAUNCHER_H__ |
| 44 | 41 |
| OLD | NEW |