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/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/host/root_window_host_factory.h" | 8 #include "ash/host/root_window_host_factory.h" |
9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
10 #include "ash/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 TabRestoreServiceFactory::GetForProfile(browser->profile()); | 158 TabRestoreServiceFactory::GetForProfile(browser->profile()); |
159 if (!service) | 159 if (!service) |
160 return; | 160 return; |
161 if (service->IsLoaded()) { | 161 if (service->IsLoaded()) { |
162 chrome::RestoreTab(browser); | 162 chrome::RestoreTab(browser); |
163 } else { | 163 } else { |
164 service->LoadTabsFromLastSession(); | 164 service->LoadTabsFromLastSession(); |
165 // LoadTabsFromLastSession is asynchronous, so TabRestoreService has not | 165 // LoadTabsFromLastSession is asynchronous, so TabRestoreService has not |
166 // finished loading the entries at this point. Wait for next event cycle | 166 // finished loading the entries at this point. Wait for next event cycle |
167 // which loads the restored tab entries. | 167 // which loads the restored tab entries. |
168 MessageLoop::current()->PostTask( | 168 base::MessageLoop::current()->PostTask( |
169 FROM_HERE, | 169 FROM_HERE, |
170 base::Bind(&ChromeShellDelegate::RestoreTab, | 170 base::Bind(&ChromeShellDelegate::RestoreTab, |
171 weak_factory_.GetWeakPtr())); | 171 weak_factory_.GetWeakPtr())); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 void ChromeShellDelegate::ShowTaskManager() { | 175 void ChromeShellDelegate::ShowTaskManager() { |
176 chrome::OpenTaskManager(NULL, false); | 176 chrome::OpenTaskManager(NULL, false); |
177 } | 177 } |
178 | 178 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 return browser; | 377 return browser; |
378 return chrome::FindOrCreateTabbedBrowser( | 378 return chrome::FindOrCreateTabbedBrowser( |
379 ProfileManager::GetDefaultProfileOrOffTheRecord(), | 379 ProfileManager::GetDefaultProfileOrOffTheRecord(), |
380 chrome::HOST_DESKTOP_TYPE_ASH); | 380 chrome::HOST_DESKTOP_TYPE_ASH); |
381 } | 381 } |
382 | 382 |
383 keyboard::KeyboardControllerProxy* | 383 keyboard::KeyboardControllerProxy* |
384 ChromeShellDelegate::CreateKeyboardControllerProxy() { | 384 ChromeShellDelegate::CreateKeyboardControllerProxy() { |
385 return new AshKeyboardControllerProxy(); | 385 return new AshKeyboardControllerProxy(); |
386 } | 386 } |
OLD | NEW |