Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/web_app_launcher.cc

Issue 19746: Remove old web app code it's no longer needed. Simplifies startup a little. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/web_app_launcher.h"
6
7 #include "base/string_util.h"
8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/profile.h"
10 #include "chrome/browser/web_app.h"
11
12 // static
13 void WebAppLauncher::Launch(Profile* profile, const GURL& url) {
14 (new WebAppLauncher(profile, url))->Run();
15 }
16
17 WebAppLauncher::WebAppLauncher(Profile* profile, const GURL& url)
18 : profile_(profile),
19 url_(url) {
20 }
21
22 void WebAppLauncher::Run() {
23 GearsQueryShortcuts(NewCallback(this, &WebAppLauncher::OnGotApps));
24 }
25
26 void WebAppLauncher::OnGotApps(GearsShortcutList* apps) {
27 WebApp* app = NULL;
28
29 if (apps) {
30 for (size_t i = 0; i < apps->num_shortcuts; ++i) {
31 if (apps->shortcuts[i].url && GURL(apps->shortcuts[i].url) == url_) {
32 app = new WebApp(profile_, apps->shortcuts[i]);
33 break;
34 }
35 }
36 }
37
38 if (!app) {
39 // Gears doesn't know about this app. Create one anyway.
40 app = new WebApp(profile_, url_, std::wstring());
41 }
42
43 Browser::OpenWebApplication(profile_, app);
44
45 delete this;
46 }
47
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698