| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/prefs/session_startup_pref.h" | 10 #include "chrome/browser/prefs/session_startup_pref.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 // Then fallback to the first of the current startup URLs - this means that | 204 // Then fallback to the first of the current startup URLs - this means that |
| 205 // URLs themselves haven't changed. | 205 // URLs themselves haven't changed. |
| 206 return new_urls[0]; | 206 return new_urls[0]; |
| 207 } | 207 } |
| 208 | 208 |
| 209 void SessionStartupChange::OpenPinnedTabs(Browser* browser, | 209 void SessionStartupChange::OpenPinnedTabs(Browser* browser, |
| 210 const StartupTabs& tabs) { | 210 const StartupTabs& tabs) { |
| 211 for (size_t i = 0; i < tabs.size(); ++i) { | 211 for (size_t i = 0; i < tabs.size(); ++i) { |
| 212 chrome::NavigateParams params(browser, tabs[i].url, | 212 chrome::NavigateParams params(browser, tabs[i].url, |
| 213 content::PAGE_TRANSITION_START_PAGE); | 213 content::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 214 params.disposition = NEW_BACKGROUND_TAB; | 214 params.disposition = NEW_BACKGROUND_TAB; |
| 215 params.tabstrip_index = -1; | 215 params.tabstrip_index = -1; |
| 216 params.tabstrip_add_types = TabStripModel::ADD_PINNED; | 216 params.tabstrip_add_types = TabStripModel::ADD_PINNED; |
| 217 params.extension_app_id = tabs[i].app_id; | 217 params.extension_app_id = tabs[i].app_id; |
| 218 chrome::Navigate(¶ms); | 218 chrome::Navigate(¶ms); |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 | 221 |
| 222 BaseSettingChange* CreateSessionStartupChange( | 222 BaseSettingChange* CreateSessionStartupChange( |
| 223 const SessionStartupPref& actual_startup_pref, | 223 const SessionStartupPref& actual_startup_pref, |
| 224 const StartupTabs& actual_pinned_tabs, | 224 const StartupTabs& actual_pinned_tabs, |
| 225 const SessionStartupPref& backup_startup_pref, | 225 const SessionStartupPref& backup_startup_pref, |
| 226 const StartupTabs& backup_pinned_tabs) { | 226 const StartupTabs& backup_pinned_tabs) { |
| 227 return new SessionStartupChange(actual_startup_pref, actual_pinned_tabs, | 227 return new SessionStartupChange(actual_startup_pref, actual_pinned_tabs, |
| 228 backup_startup_pref, backup_pinned_tabs); | 228 backup_startup_pref, backup_pinned_tabs); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace protector | 231 } // namespace protector |
| OLD | NEW |