OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Having the app launcher installed does not mean the user has Chrome | 269 // Having the app launcher installed does not mean the user has Chrome |
270 // installed, or set as the default browser. The behavior for app launch needs | 270 // installed, or set as the default browser. The behavior for app launch needs |
271 // to be consistent but also respect the users default browser choice for apps | 271 // to be consistent but also respect the users default browser choice for apps |
272 // which appear as web sites, and never show chrome the browser if it is not | 272 // which appear as web sites, and never show chrome the browser if it is not |
273 // installed. | 273 // installed. |
274 // The launch behavior is: | 274 // The launch behavior is: |
275 // - v1 hosted apps: if chrome is not default browser, launch in default | 275 // - v1 hosted apps: if chrome is not default browser, launch in default |
276 // browser; otherwise launch in chrome | 276 // browser; otherwise launch in chrome |
277 // - v1 packaged apps : open in an app window | 277 // - v1 packaged apps : open in an app window |
278 // - v2 packaged apps : launch normally | 278 // - v2 packaged apps : launch normally |
279 if (extension->is_hosted_app()) { | 279 // Note: a special case, the ChromeApp, should always launch Chrome. |
| 280 if (extension->is_hosted_app() && |
| 281 extension->id() != extension_misc::kChromeAppId) { |
280 content::BrowserThread::PostTask( | 282 content::BrowserThread::PostTask( |
281 content::BrowserThread::FILE, | 283 content::BrowserThread::FILE, |
282 FROM_HERE, | 284 FROM_HERE, |
283 base::Bind(&LaunchHostedAppOnFileThread, | 285 base::Bind(&LaunchHostedAppOnFileThread, |
284 extension->GetFullLaunchURL(), | 286 extension->GetFullLaunchURL(), |
285 extension->id(), | 287 extension->id(), |
286 profile)); | 288 profile)); |
287 return; | 289 return; |
288 } | 290 } |
289 | 291 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 base::Bind(&CreateAppList), | 649 base::Bind(&CreateAppList), |
648 base::TimeDelta::FromSeconds(kInitWindowDelay)); | 650 base::TimeDelta::FromSeconds(kInitWindowDelay)); |
649 } | 651 } |
650 | 652 |
651 void ShowAppList() { | 653 void ShowAppList() { |
652 // Create the App list. | 654 // Create the App list. |
653 g_app_list_controller.Get().ShowAppList(); | 655 g_app_list_controller.Get().ShowAppList(); |
654 } | 656 } |
655 | 657 |
656 } // namespace chrome | 658 } // namespace chrome |
OLD | NEW |