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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "chrome/common/chrome_switches.h" | 70 #include "chrome/common/chrome_switches.h" |
71 #include "chrome/common/chrome_version_info.h" | 71 #include "chrome/common/chrome_version_info.h" |
72 #include "chrome/common/extensions/extension_constants.h" | 72 #include "chrome/common/extensions/extension_constants.h" |
73 #include "chrome/common/pref_names.h" | 73 #include "chrome/common/pref_names.h" |
74 #include "chrome/common/url_constants.h" | 74 #include "chrome/common/url_constants.h" |
75 #include "chrome/installer/util/browser_distribution.h" | 75 #include "chrome/installer/util/browser_distribution.h" |
76 #include "content/public/browser/child_process_security_policy.h" | 76 #include "content/public/browser/child_process_security_policy.h" |
77 #include "content/public/browser/dom_storage_context.h" | 77 #include "content/public/browser/dom_storage_context.h" |
78 #include "content/public/browser/notification_observer.h" | 78 #include "content/public/browser/notification_observer.h" |
79 #include "content/public/browser/notification_registrar.h" | 79 #include "content/public/browser/notification_registrar.h" |
| 80 #include "content/public/browser/storage_partition.h" |
80 #include "content/public/browser/web_contents.h" | 81 #include "content/public/browser/web_contents.h" |
81 #include "content/public/browser/web_contents_view.h" | 82 #include "content/public/browser/web_contents_view.h" |
82 #include "grit/locale_settings.h" | 83 #include "grit/locale_settings.h" |
83 #include "ui/base/l10n/l10n_util.h" | 84 #include "ui/base/l10n/l10n_util.h" |
84 #include "ui/base/resource/resource_bundle.h" | 85 #include "ui/base/resource/resource_bundle.h" |
85 | 86 |
86 #if defined(OS_MACOSX) | 87 #if defined(OS_MACOSX) |
87 #include "base/mac/mac_util.h" | 88 #include "base/mac/mac_util.h" |
88 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 89 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
89 #endif | 90 #endif |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 if (!browser) | 640 if (!browser) |
640 return false; | 641 return false; |
641 | 642 |
642 AddInfoBarsIfNecessary(browser, chrome::startup::IS_PROCESS_STARTUP); | 643 AddInfoBarsIfNecessary(browser, chrome::startup::IS_PROCESS_STARTUP); |
643 | 644 |
644 // Session restore may occur if the startup preference is "last" or if the | 645 // Session restore may occur if the startup preference is "last" or if the |
645 // crash infobar is displayed. Otherwise, it's safe for the DOM storage system | 646 // crash infobar is displayed. Otherwise, it's safe for the DOM storage system |
646 // to start deleting leftover data. | 647 // to start deleting leftover data. |
647 if (pref.type != SessionStartupPref::LAST && | 648 if (pref.type != SessionStartupPref::LAST && |
648 !HasPendingUncleanExit(profile_)) { | 649 !HasPendingUncleanExit(profile_)) { |
649 content::BrowserContext::GetDefaultDOMStorageContext(profile_)-> | 650 content::BrowserContext::GetDefaultStoragePartition(profile_)-> |
650 StartScavengingUnusedSessionStorage(); | 651 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); |
651 } | 652 } |
652 | 653 |
653 return true; | 654 return true; |
654 } | 655 } |
655 | 656 |
656 Browser* StartupBrowserCreatorImpl::ProcessSpecifiedURLs( | 657 Browser* StartupBrowserCreatorImpl::ProcessSpecifiedURLs( |
657 const std::vector<GURL>& urls_to_open) { | 658 const std::vector<GURL>& urls_to_open) { |
658 SessionStartupPref pref = | 659 SessionStartupPref pref = |
659 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); | 660 StartupBrowserCreator::GetSessionStartupPref(command_line_, profile_); |
660 StartupTabs tabs; | 661 StartupTabs tabs; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 // New: | 940 // New: |
940 prefs->GetString(prefs::kHomePage), | 941 prefs->GetString(prefs::kHomePage), |
941 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 942 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
942 prefs->GetBoolean(prefs::kShowHomeButton), | 943 prefs->GetBoolean(prefs::kShowHomeButton), |
943 // Backup: | 944 // Backup: |
944 backup_homepage, | 945 backup_homepage, |
945 backup_homepage_is_ntp, | 946 backup_homepage_is_ntp, |
946 backup_show_home_button)); | 947 backup_show_home_button)); |
947 } | 948 } |
948 } | 949 } |
OLD | NEW |