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" | 10 #include "apps/app_restore_service.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/extensions/launch_util.h" | 37 #include "chrome/browser/extensions/launch_util.h" |
38 #include "chrome/browser/extensions/pack_extension_job.h" | 38 #include "chrome/browser/extensions/pack_extension_job.h" |
39 #include "chrome/browser/first_run/first_run.h" | 39 #include "chrome/browser/first_run/first_run.h" |
40 #include "chrome/browser/infobars/infobar_service.h" | 40 #include "chrome/browser/infobars/infobar_service.h" |
41 #include "chrome/browser/net/predictor.h" | 41 #include "chrome/browser/net/predictor.h" |
42 #include "chrome/browser/notifications/desktop_notification_service.h" | 42 #include "chrome/browser/notifications/desktop_notification_service.h" |
43 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 43 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
44 #include "chrome/browser/prefs/session_startup_pref.h" | 44 #include "chrome/browser/prefs/session_startup_pref.h" |
45 #include "chrome/browser/profiles/profile.h" | 45 #include "chrome/browser/profiles/profile.h" |
46 #include "chrome/browser/profiles/profile_io_data.h" | 46 #include "chrome/browser/profiles/profile_io_data.h" |
47 #include "chrome/browser/rlz/rlz.h" | |
48 #include "chrome/browser/sessions/session_restore.h" | 47 #include "chrome/browser/sessions/session_restore.h" |
49 #include "chrome/browser/sessions/session_service.h" | 48 #include "chrome/browser/sessions/session_service.h" |
50 #include "chrome/browser/sessions/session_service_factory.h" | 49 #include "chrome/browser/sessions/session_service_factory.h" |
51 #include "chrome/browser/shell_integration.h" | 50 #include "chrome/browser/shell_integration.h" |
52 #include "chrome/browser/signin/signin_promo.h" | 51 #include "chrome/browser/signin/signin_promo.h" |
53 #include "chrome/browser/ui/app_list/app_list_service.h" | 52 #include "chrome/browser/ui/app_list/app_list_service.h" |
54 #include "chrome/browser/ui/browser_commands.h" | 53 #include "chrome/browser/ui/browser_commands.h" |
55 #include "chrome/browser/ui/browser_finder.h" | 54 #include "chrome/browser/ui/browser_finder.h" |
56 #include "chrome/browser/ui/browser_list.h" | 55 #include "chrome/browser/ui/browser_list.h" |
57 #include "chrome/browser/ui/browser_navigator.h" | 56 #include "chrome/browser/ui/browser_navigator.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 #if defined(OS_MACOSX) | 98 #if defined(OS_MACOSX) |
100 #include "base/mac/mac_util.h" | 99 #include "base/mac/mac_util.h" |
101 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 100 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
102 #endif | 101 #endif |
103 | 102 |
104 #if defined(OS_WIN) | 103 #if defined(OS_WIN) |
105 #include "base/win/windows_version.h" | 104 #include "base/win/windows_version.h" |
106 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" | 105 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" |
107 #endif | 106 #endif |
108 | 107 |
| 108 #if defined(ENABLE_RLZ) |
| 109 #include "components/rlz/rlz_tracker.h" |
| 110 #endif |
| 111 |
109 using content::ChildProcessSecurityPolicy; | 112 using content::ChildProcessSecurityPolicy; |
110 using content::WebContents; | 113 using content::WebContents; |
111 using extensions::Extension; | 114 using extensions::Extension; |
112 | 115 |
113 namespace { | 116 namespace { |
114 | 117 |
115 // Utility functions ---------------------------------------------------------- | 118 // Utility functions ---------------------------------------------------------- |
116 | 119 |
117 enum LaunchMode { | 120 enum LaunchMode { |
118 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. | 121 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 if (tabs[i].is_pinned) | 808 if (tabs[i].is_pinned) |
806 add_types |= TabStripModel::ADD_PINNED; | 809 add_types |= TabStripModel::ADD_PINNED; |
807 | 810 |
808 chrome::NavigateParams params(browser, tabs[i].url, | 811 chrome::NavigateParams params(browser, tabs[i].url, |
809 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); | 812 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); |
810 params.disposition = first_tab ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 813 params.disposition = first_tab ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
811 params.tabstrip_add_types = add_types; | 814 params.tabstrip_add_types = add_types; |
812 | 815 |
813 #if defined(ENABLE_RLZ) && !defined(OS_IOS) | 816 #if defined(ENABLE_RLZ) && !defined(OS_IOS) |
814 if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) { | 817 if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) { |
815 params.extra_headers = RLZTracker::GetAccessPointHttpHeader( | 818 params.extra_headers = rlz::RLZTracker::GetAccessPointHttpHeader( |
816 RLZTracker::ChromeHomePage()); | 819 rlz::RLZTracker::ChromeHomePage()); |
817 } | 820 } |
818 #endif // defined(ENABLE_RLZ) && !defined(OS_IOS) | 821 #endif // defined(ENABLE_RLZ) && !defined(OS_IOS) |
819 | 822 |
820 chrome::Navigate(¶ms); | 823 chrome::Navigate(¶ms); |
821 | 824 |
822 first_tab = false; | 825 first_tab = false; |
823 } | 826 } |
824 if (!browser->tab_strip_model()->GetActiveWebContents()) { | 827 if (!browser->tab_strip_model()->GetActiveWebContents()) { |
825 // TODO: this is a work around for 110909. Figure out why it's needed. | 828 // TODO: this is a work around for 110909. Figure out why it's needed. |
826 if (!browser->tab_strip_model()->count()) | 829 if (!browser->tab_strip_model()->count()) |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 } | 1010 } |
1008 | 1011 |
1009 // Remember that the welcome page was shown for this OS version. | 1012 // Remember that the welcome page was shown for this OS version. |
1010 local_state->SetString(prefs::kLastWelcomedOSVersion, this_version); | 1013 local_state->SetString(prefs::kLastWelcomedOSVersion, this_version); |
1011 #else // OS_WIN | 1014 #else // OS_WIN |
1012 // Show the welcome page as the last tab only on first-run. | 1015 // Show the welcome page as the last tab only on first-run. |
1013 if (first_run::ShouldShowWelcomePage()) | 1016 if (first_run::ShouldShowWelcomePage()) |
1014 welcome_run_type_ = WelcomeRunType::FIRST_RUN_LAST_TAB; | 1017 welcome_run_type_ = WelcomeRunType::FIRST_RUN_LAST_TAB; |
1015 #endif // !OS_WIN | 1018 #endif // !OS_WIN |
1016 } | 1019 } |
OLD | NEW |