| 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" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void ChromeNewWindowDelegate::NewTab() { | 81 void ChromeNewWindowDelegate::NewTab() { |
| 82 Browser* browser = GetBrowserForActiveWindow(); | 82 Browser* browser = GetBrowserForActiveWindow(); |
| 83 if (browser && browser->is_type_tabbed()) { | 83 if (browser && browser->is_type_tabbed()) { |
| 84 chrome::NewTab(browser); | 84 chrome::NewTab(browser); |
| 85 return; | 85 return; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Display a browser, setting the focus to the location bar after it is shown. | 88 // Display a browser, setting the focus to the location bar after it is shown. |
| 89 { | 89 { |
| 90 chrome::ScopedTabbedBrowserDisplayer displayer( | 90 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 91 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 91 ProfileManager::GetActiveUserProfile()); |
| 92 browser = displayer.browser(); | 92 browser = displayer.browser(); |
| 93 chrome::NewTab(browser); | 93 chrome::NewTab(browser); |
| 94 } | 94 } |
| 95 | 95 |
| 96 browser->SetFocusToLocationBar(false); | 96 browser->SetFocusToLocationBar(false); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ChromeNewWindowDelegate::NewWindow(bool is_incognito) { | 99 void ChromeNewWindowDelegate::NewWindow(bool is_incognito) { |
| 100 Profile* profile = ProfileManager::GetActiveUserProfile(); | 100 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 101 chrome::NewEmptyWindow( | 101 chrome::NewEmptyWindow(is_incognito ? profile->GetOffTheRecordProfile() |
| 102 is_incognito ? profile->GetOffTheRecordProfile() : profile, | 102 : profile); |
| 103 chrome::HOST_DESKTOP_TYPE_ASH); | |
| 104 } | 103 } |
| 105 | 104 |
| 106 void ChromeNewWindowDelegate::RestoreTab() { | 105 void ChromeNewWindowDelegate::RestoreTab() { |
| 107 if (tab_restore_helper_.get()) { | 106 if (tab_restore_helper_.get()) { |
| 108 DCHECK(!tab_restore_helper_->tab_restore_service()->IsLoaded()); | 107 DCHECK(!tab_restore_helper_->tab_restore_service()->IsLoaded()); |
| 109 return; | 108 return; |
| 110 } | 109 } |
| 111 | 110 |
| 112 Browser* browser = GetBrowserForActiveWindow(); | 111 Browser* browser = GetBrowserForActiveWindow(); |
| 113 Profile* profile = browser ? browser->profile() : NULL; | 112 Profile* profile = browser ? browser->profile() : NULL; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 128 } | 127 } |
| 129 } | 128 } |
| 130 | 129 |
| 131 void ChromeNewWindowDelegate::ShowTaskManager() { | 130 void ChromeNewWindowDelegate::ShowTaskManager() { |
| 132 chrome::OpenTaskManager(NULL); | 131 chrome::OpenTaskManager(NULL); |
| 133 } | 132 } |
| 134 | 133 |
| 135 void ChromeNewWindowDelegate::OpenFeedbackPage() { | 134 void ChromeNewWindowDelegate::OpenFeedbackPage() { |
| 136 chrome::OpenFeedbackDialog(GetBrowserForActiveWindow()); | 135 chrome::OpenFeedbackDialog(GetBrowserForActiveWindow()); |
| 137 } | 136 } |
| OLD | NEW |