| 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 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/extensions/launch_util.h" | 36 #include "chrome/browser/extensions/launch_util.h" |
| 37 #include "chrome/browser/extensions/pack_extension_job.h" | 37 #include "chrome/browser/extensions/pack_extension_job.h" |
| 38 #include "chrome/browser/first_run/first_run.h" | 38 #include "chrome/browser/first_run/first_run.h" |
| 39 #include "chrome/browser/infobars/infobar_service.h" | 39 #include "chrome/browser/infobars/infobar_service.h" |
| 40 #include "chrome/browser/net/predictor.h" | 40 #include "chrome/browser/net/predictor.h" |
| 41 #include "chrome/browser/notifications/desktop_notification_service.h" | 41 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 42 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 42 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 43 #include "chrome/browser/prefs/session_startup_pref.h" | 43 #include "chrome/browser/prefs/session_startup_pref.h" |
| 44 #include "chrome/browser/profiles/profile.h" | 44 #include "chrome/browser/profiles/profile.h" |
| 45 #include "chrome/browser/profiles/profile_io_data.h" | 45 #include "chrome/browser/profiles/profile_io_data.h" |
| 46 #include "chrome/browser/rlz/rlz.h" |
| 46 #include "chrome/browser/sessions/session_restore.h" | 47 #include "chrome/browser/sessions/session_restore.h" |
| 47 #include "chrome/browser/sessions/session_service.h" | 48 #include "chrome/browser/sessions/session_service.h" |
| 48 #include "chrome/browser/sessions/session_service_factory.h" | 49 #include "chrome/browser/sessions/session_service_factory.h" |
| 49 #include "chrome/browser/shell_integration.h" | 50 #include "chrome/browser/shell_integration.h" |
| 50 #include "chrome/browser/signin/signin_promo.h" | 51 #include "chrome/browser/signin/signin_promo.h" |
| 51 #include "chrome/browser/ui/app_list/app_list_service.h" | 52 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 52 #include "chrome/browser/ui/browser_commands.h" | 53 #include "chrome/browser/ui/browser_commands.h" |
| 53 #include "chrome/browser/ui/browser_finder.h" | 54 #include "chrome/browser/ui/browser_finder.h" |
| 54 #include "chrome/browser/ui/browser_list.h" | 55 #include "chrome/browser/ui/browser_list.h" |
| 55 #include "chrome/browser/ui/browser_navigator.h" | 56 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 #if defined(OS_MACOSX) | 96 #if defined(OS_MACOSX) |
| 96 #include "base/mac/mac_util.h" | 97 #include "base/mac/mac_util.h" |
| 97 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 98 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
| 98 #endif | 99 #endif |
| 99 | 100 |
| 100 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 101 #include "base/win/windows_version.h" | 102 #include "base/win/windows_version.h" |
| 102 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" | 103 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" |
| 103 #endif | 104 #endif |
| 104 | 105 |
| 105 #if defined(ENABLE_RLZ) | |
| 106 #include "components/rlz/rlz_tracker.h" | |
| 107 #endif | |
| 108 | |
| 109 using content::ChildProcessSecurityPolicy; | 106 using content::ChildProcessSecurityPolicy; |
| 110 using content::WebContents; | 107 using content::WebContents; |
| 111 using extensions::Extension; | 108 using extensions::Extension; |
| 112 | 109 |
| 113 namespace { | 110 namespace { |
| 114 | 111 |
| 115 // Utility functions ---------------------------------------------------------- | 112 // Utility functions ---------------------------------------------------------- |
| 116 | 113 |
| 117 enum LaunchMode { | 114 enum LaunchMode { |
| 118 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. | 115 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 if (tabs[i].is_pinned) | 781 if (tabs[i].is_pinned) |
| 785 add_types |= TabStripModel::ADD_PINNED; | 782 add_types |= TabStripModel::ADD_PINNED; |
| 786 | 783 |
| 787 chrome::NavigateParams params(browser, tabs[i].url, | 784 chrome::NavigateParams params(browser, tabs[i].url, |
| 788 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); | 785 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 789 params.disposition = first_tab ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 786 params.disposition = first_tab ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
| 790 params.tabstrip_add_types = add_types; | 787 params.tabstrip_add_types = add_types; |
| 791 | 788 |
| 792 #if defined(ENABLE_RLZ) && !defined(OS_IOS) | 789 #if defined(ENABLE_RLZ) && !defined(OS_IOS) |
| 793 if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) { | 790 if (process_startup && google_util::IsGoogleHomePageUrl(tabs[i].url)) { |
| 794 params.extra_headers = rlz::RLZTracker::GetAccessPointHttpHeader( | 791 params.extra_headers = RLZTracker::GetAccessPointHttpHeader( |
| 795 rlz::RLZTracker::ChromeHomePage()); | 792 RLZTracker::ChromeHomePage()); |
| 796 } | 793 } |
| 797 #endif // defined(ENABLE_RLZ) && !defined(OS_IOS) | 794 #endif // defined(ENABLE_RLZ) && !defined(OS_IOS) |
| 798 | 795 |
| 799 chrome::Navigate(¶ms); | 796 chrome::Navigate(¶ms); |
| 800 | 797 |
| 801 first_tab = false; | 798 first_tab = false; |
| 802 } | 799 } |
| 803 if (!browser->tab_strip_model()->GetActiveWebContents()) { | 800 if (!browser->tab_strip_model()->GetActiveWebContents()) { |
| 804 // TODO: this is a work around for 110909. Figure out why it's needed. | 801 // TODO: this is a work around for 110909. Figure out why it's needed. |
| 805 if (!browser->tab_strip_model()->count()) | 802 if (!browser->tab_strip_model()->count()) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 // behavior is desired because completing or skipping the sync promo | 910 // behavior is desired because completing or skipping the sync promo |
| 914 // causes a redirect to the NTP. | 911 // causes a redirect to the NTP. |
| 915 if (!startup_urls->empty() && | 912 if (!startup_urls->empty() && |
| 916 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) | 913 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) |
| 917 startup_urls->at(0) = sync_promo_url; | 914 startup_urls->at(0) = sync_promo_url; |
| 918 else | 915 else |
| 919 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 916 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
| 920 } | 917 } |
| 921 } | 918 } |
| 922 } | 919 } |
| OLD | NEW |