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 "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 const Extension* extension; | 385 const Extension* extension; |
386 if (!GetAppLaunchContainer(profile, app_id, &extension, &launch_container)) | 386 if (!GetAppLaunchContainer(profile, app_id, &extension, &launch_container)) |
387 return false; | 387 return false; |
388 | 388 |
389 // If the user doesn't want to open a tab, fail. | 389 // If the user doesn't want to open a tab, fail. |
390 if (launch_container != extension_misc::LAUNCH_TAB) | 390 if (launch_container != extension_misc::LAUNCH_TAB) |
391 return false; | 391 return false; |
392 | 392 |
393 RecordCmdLineAppHistogram(); | 393 RecordCmdLineAppHistogram(); |
394 | 394 |
395 WebContents* app_tab = application_launch::OpenApplicationTab( | 395 WebContents* app_tab = application_launch::OpenApplication( |
396 profile, extension, GURL(), NEW_FOREGROUND_TAB); | 396 application_launch::LaunchParams(profile, extension, |
| 397 extension_misc::LAUNCH_TAB, NEW_FOREGROUND_TAB)); |
397 return (app_tab != NULL); | 398 return (app_tab != NULL); |
398 } | 399 } |
399 | 400 |
400 bool StartupBrowserCreatorImpl::OpenApplicationWindow( | 401 bool StartupBrowserCreatorImpl::OpenApplicationWindow( |
401 Profile* profile, | 402 Profile* profile, |
402 content::WebContents** out_app_contents) { | 403 content::WebContents** out_app_contents) { |
403 // Set |out_app_contents| to NULL early on (just in case). | 404 // Set |out_app_contents| to NULL early on (just in case). |
404 if (out_app_contents) | 405 if (out_app_contents) |
405 *out_app_contents = NULL; | 406 *out_app_contents = NULL; |
406 | 407 |
(...skipping 13 matching lines...) Expand all Loading... |
420 | 421 |
421 // TODO(skerner): Could pass in |extension| and |launch_container|, | 422 // TODO(skerner): Could pass in |extension| and |launch_container|, |
422 // and avoid calling GetAppLaunchContainer() both here and in | 423 // and avoid calling GetAppLaunchContainer() both here and in |
423 // OpenApplicationTab(). | 424 // OpenApplicationTab(). |
424 | 425 |
425 if (launch_container == extension_misc::LAUNCH_TAB) | 426 if (launch_container == extension_misc::LAUNCH_TAB) |
426 return false; | 427 return false; |
427 | 428 |
428 RecordCmdLineAppHistogram(); | 429 RecordCmdLineAppHistogram(); |
429 | 430 |
| 431 application_launch::LaunchParams params(profile, extension, |
| 432 launch_container, NEW_WINDOW); |
| 433 params.command_line = &command_line_; |
430 WebContents* tab_in_app_window = application_launch::OpenApplication( | 434 WebContents* tab_in_app_window = application_launch::OpenApplication( |
431 profile, extension, launch_container, GURL(), NEW_WINDOW, | 435 params); |
432 &command_line_); | |
433 | 436 |
434 if (out_app_contents) | 437 if (out_app_contents) |
435 *out_app_contents = tab_in_app_window; | 438 *out_app_contents = tab_in_app_window; |
436 | 439 |
437 // Platform apps fire off a launch event which may or may not open a window. | 440 // Platform apps fire off a launch event which may or may not open a window. |
438 return (tab_in_app_window != NULL || extension->is_platform_app()); | 441 return (tab_in_app_window != NULL || extension->is_platform_app()); |
439 } | 442 } |
440 | 443 |
441 if (url_string.empty()) | 444 if (url_string.empty()) |
442 return false; | 445 return false; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 // New: | 864 // New: |
862 prefs->GetString(prefs::kHomePage), | 865 prefs->GetString(prefs::kHomePage), |
863 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 866 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
864 prefs->GetBoolean(prefs::kShowHomeButton), | 867 prefs->GetBoolean(prefs::kShowHomeButton), |
865 // Backup: | 868 // Backup: |
866 backup_homepage, | 869 backup_homepage, |
867 backup_homepage_is_ntp, | 870 backup_homepage_is_ntp, |
868 backup_show_home_button)); | 871 backup_show_home_button)); |
869 } | 872 } |
870 } | 873 } |
OLD | NEW |