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/views/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include "ash/launcher/launcher_types.h" | 7 #include "ash/launcher/launcher_types.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/wm/partial_screenshot_view.h" | 9 #include "ash/wm/partial_screenshot_view.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void ChromeShellDelegate::RestoreTab() { | 207 void ChromeShellDelegate::RestoreTab() { |
208 Browser* browser = GetTargetBrowser(); | 208 Browser* browser = GetTargetBrowser(); |
209 // Do not restore tabs while in the incognito mode. | 209 // Do not restore tabs while in the incognito mode. |
210 if (browser->profile()->IsOffTheRecord()) | 210 if (browser->profile()->IsOffTheRecord()) |
211 return; | 211 return; |
212 TabRestoreService* service = | 212 TabRestoreService* service = |
213 TabRestoreServiceFactory::GetForProfile(browser->profile()); | 213 TabRestoreServiceFactory::GetForProfile(browser->profile()); |
214 if (!service) | 214 if (!service) |
215 return; | 215 return; |
216 if (service->IsLoaded()) { | 216 if (service->IsLoaded()) { |
217 browser->RestoreTab(); | 217 chrome::RestoreTab(browser); |
218 } else { | 218 } else { |
219 service->LoadTabsFromLastSession(); | 219 service->LoadTabsFromLastSession(); |
220 // LoadTabsFromLastSession is asynchronous, so TabRestoreService has not | 220 // LoadTabsFromLastSession is asynchronous, so TabRestoreService has not |
221 // finished loading the entries at this point. Wait for next event cycle | 221 // finished loading the entries at this point. Wait for next event cycle |
222 // which loads the restored tab entries. | 222 // which loads the restored tab entries. |
223 MessageLoop::current()->PostTask( | 223 MessageLoop::current()->PostTask( |
224 FROM_HERE, | 224 FROM_HERE, |
225 base::Bind(&ChromeShellDelegate::RestoreTab, | 225 base::Bind(&ChromeShellDelegate::RestoreTab, |
226 weak_factory_.GetWeakPtr())); | 226 weak_factory_.GetWeakPtr())); |
227 } | 227 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 ash::Shell::GetInstance()->CreateLauncher(); | 333 ash::Shell::GetInstance()->CreateLauncher(); |
334 break; | 334 break; |
335 default: | 335 default: |
336 NOTREACHED() << "Unexpected notification " << type; | 336 NOTREACHED() << "Unexpected notification " << type; |
337 } | 337 } |
338 #else | 338 #else |
339 // MSVC++ warns about switch statements without any cases. | 339 // MSVC++ warns about switch statements without any cases. |
340 NOTREACHED() << "Unexpected notification " << type; | 340 NOTREACHED() << "Unexpected notification " << type; |
341 #endif | 341 #endif |
342 } | 342 } |
OLD | NEW |