| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_new_window_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_new_window_delegate.h" |
| 6 | 6 |
| 7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 10 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 10 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 11 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 11 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_commands.h" | 13 #include "chrome/browser/ui/browser_commands.h" |
| 14 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 16 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 17 #include "components/sessions/core/tab_restore_service.h" | 17 #include "components/sessions/core/tab_restore_service.h" |
| 18 #include "components/sessions/core/tab_restore_service_observer.h" | 18 #include "components/sessions/core/tab_restore_service_observer.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 void RestoreTabUsingProfile(Profile* profile) { | 22 void RestoreTabUsingProfile(Profile* profile) { |
| 23 sessions::TabRestoreService* service = | 23 sessions::TabRestoreService* service = |
| 24 TabRestoreServiceFactory::GetForProfile(profile); | 24 TabRestoreServiceFactory::GetForProfile(profile); |
| 25 service->RestoreMostRecentEntry(NULL, chrome::HOST_DESKTOP_TYPE_ASH); | 25 service->RestoreMostRecentEntry(nullptr); |
| 26 } | 26 } |
| 27 | 27 |
| 28 // Returns the browser for the active window, if any. | 28 // Returns the browser for the active window, if any. |
| 29 Browser* GetBrowserForActiveWindow() { | 29 Browser* GetBrowserForActiveWindow() { |
| 30 return chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); | 30 return chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 ChromeNewWindowDelegate::ChromeNewWindowDelegate() {} | 35 ChromeNewWindowDelegate::ChromeNewWindowDelegate() {} |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 void ChromeNewWindowDelegate::ShowTaskManager() { | 130 void ChromeNewWindowDelegate::ShowTaskManager() { |
| 131 chrome::OpenTaskManager(NULL); | 131 chrome::OpenTaskManager(NULL); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void ChromeNewWindowDelegate::OpenFeedbackPage() { | 134 void ChromeNewWindowDelegate::OpenFeedbackPage() { |
| 135 chrome::OpenFeedbackDialog(GetBrowserForActiveWindow()); | 135 chrome::OpenFeedbackDialog(GetBrowserForActiveWindow()); |
| 136 } | 136 } |
| OLD | NEW |