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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "apps/app_restore_service.h" |
| 11 #include "apps/app_restore_service_factory.h" |
10 #include "base/bind.h" | 12 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
12 #include "base/command_line.h" | 14 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
14 #include "base/environment.h" | 16 #include "base/environment.h" |
15 #include "base/event_recorder.h" | 17 #include "base/event_recorder.h" |
16 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
17 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
18 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
19 #include "base/metrics/statistics_recorder.h" | 21 #include "base/metrics/statistics_recorder.h" |
20 #include "base/path_service.h" | 22 #include "base/path_service.h" |
21 #include "base/string_number_conversions.h" | 23 #include "base/string_number_conversions.h" |
22 #include "base/string_split.h" | 24 #include "base/string_split.h" |
23 #include "base/threading/thread_restrictions.h" | 25 #include "base/threading/thread_restrictions.h" |
24 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
25 #include "chrome/browser/api/infobars/infobar_service.h" | 27 #include "chrome/browser/api/infobars/infobar_service.h" |
26 #include "chrome/browser/auto_launch_trial.h" | 28 #include "chrome/browser/auto_launch_trial.h" |
27 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 30 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
29 #include "chrome/browser/defaults.h" | 31 #include "chrome/browser/defaults.h" |
30 #include "chrome/browser/extensions/app_restore_service.h" | |
31 #include "chrome/browser/extensions/app_restore_service_factory.h" | |
32 #include "chrome/browser/extensions/extension_creator.h" | 32 #include "chrome/browser/extensions/extension_creator.h" |
33 #include "chrome/browser/extensions/extension_service.h" | 33 #include "chrome/browser/extensions/extension_service.h" |
34 #include "chrome/browser/extensions/pack_extension_job.h" | 34 #include "chrome/browser/extensions/pack_extension_job.h" |
35 #include "chrome/browser/first_run/first_run.h" | 35 #include "chrome/browser/first_run/first_run.h" |
36 #include "chrome/browser/google/google_util.h" | 36 #include "chrome/browser/google/google_util.h" |
37 #include "chrome/browser/net/predictor.h" | 37 #include "chrome/browser/net/predictor.h" |
38 #include "chrome/browser/net/url_fixer_upper.h" | 38 #include "chrome/browser/net/url_fixer_upper.h" |
39 #include "chrome/browser/notifications/desktop_notification_service.h" | 39 #include "chrome/browser/notifications/desktop_notification_service.h" |
40 #include "chrome/browser/performance_monitor/startup_timer.h" | 40 #include "chrome/browser/performance_monitor/startup_timer.h" |
41 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 41 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; | 613 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; |
614 SessionStartupPref pref = | 614 SessionStartupPref pref = |
615 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); | 615 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); |
616 if (pref.type == SessionStartupPref::LAST) | 616 if (pref.type == SessionStartupPref::LAST) |
617 VLOG(1) << "Pref: last"; | 617 VLOG(1) << "Pref: last"; |
618 else if (pref.type == SessionStartupPref::URLS) | 618 else if (pref.type == SessionStartupPref::URLS) |
619 VLOG(1) << "Pref: urls"; | 619 VLOG(1) << "Pref: urls"; |
620 else if (pref.type == SessionStartupPref::DEFAULT) | 620 else if (pref.type == SessionStartupPref::DEFAULT) |
621 VLOG(1) << "Pref: default"; | 621 VLOG(1) << "Pref: default"; |
622 | 622 |
623 extensions::AppRestoreService* service = | 623 apps::AppRestoreService* service = |
624 extensions::AppRestoreServiceFactory::GetForProfile(profile_); | 624 apps::AppRestoreServiceFactory::GetForProfile(profile_); |
625 // NULL in incognito mode. | 625 // NULL in incognito mode. |
626 if (service) { | 626 if (service) { |
627 bool should_restore_apps = StartupBrowserCreator::WasRestarted(); | 627 bool should_restore_apps = StartupBrowserCreator::WasRestarted(); |
628 #if defined(OS_CHROMEOS) | 628 #if defined(OS_CHROMEOS) |
629 // Chromeos always restarts apps, even if it was a regular shutdown. | 629 // Chromeos always restarts apps, even if it was a regular shutdown. |
630 should_restore_apps = true; | 630 should_restore_apps = true; |
631 #endif | 631 #endif |
632 service->HandleStartup(should_restore_apps); | 632 service->HandleStartup(should_restore_apps); |
633 } | 633 } |
634 if (pref.type == SessionStartupPref::LAST) { | 634 if (pref.type == SessionStartupPref::LAST) { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 } | 957 } |
958 | 958 |
959 #if !defined(OS_WIN) || defined(USE_AURA) | 959 #if !defined(OS_WIN) || defined(USE_AURA) |
960 // static | 960 // static |
961 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 961 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
962 Profile* profile, | 962 Profile* profile, |
963 const std::vector<GURL>& startup_urls) { | 963 const std::vector<GURL>& startup_urls) { |
964 return false; | 964 return false; |
965 } | 965 } |
966 #endif | 966 #endif |
OLD | NEW |