| 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/browser_tab_strip_model_delegate.h" | 5 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // We only create historical tab entries for tabbed browser windows. | 114 // We only create historical tab entries for tabbed browser windows. |
| 115 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { | 115 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { |
| 116 service->CreateHistoricalTab( | 116 service->CreateHistoricalTab( |
| 117 contents, | 117 contents, |
| 118 browser_->tab_strip_model()->GetIndexOfWebContents(contents)); | 118 browser_->tab_strip_model()->GetIndexOfWebContents(contents)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( | 122 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( |
| 123 content::WebContents* contents) { | 123 content::WebContents* contents) { |
| 124 if (CommandLine::ForCurrentProcess()->HasSwitch( | 124 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 125 switches::kEnableFastUnload)) { | 125 switches::kEnableFastUnload)) { |
| 126 return chrome::FastUnloadController::RunUnloadEventsHelper(contents); | 126 return chrome::FastUnloadController::RunUnloadEventsHelper(contents); |
| 127 } | 127 } |
| 128 return chrome::UnloadController::RunUnloadEventsHelper(contents); | 128 return chrome::UnloadController::RunUnloadEventsHelper(contents); |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool BrowserTabStripModelDelegate::ShouldRunUnloadListenerBeforeClosing( | 131 bool BrowserTabStripModelDelegate::ShouldRunUnloadListenerBeforeClosing( |
| 132 content::WebContents* contents) { | 132 content::WebContents* contents) { |
| 133 if (CommandLine::ForCurrentProcess()->HasSwitch( | 133 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 134 switches::kEnableFastUnload)) { | 134 switches::kEnableFastUnload)) { |
| 135 return chrome::FastUnloadController::ShouldRunUnloadEventsHelper(contents); | 135 return chrome::FastUnloadController::ShouldRunUnloadEventsHelper(contents); |
| 136 } | 136 } |
| 137 return chrome::UnloadController::ShouldRunUnloadEventsHelper(contents); | 137 return chrome::UnloadController::ShouldRunUnloadEventsHelper(contents); |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { | 140 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { |
| 141 return chrome::CanBookmarkAllTabs(browser_); | 141 return chrome::CanBookmarkAllTabs(browser_); |
| 142 } | 142 } |
| 143 | 143 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 //////////////////////////////////////////////////////////////////////////////// | 157 //////////////////////////////////////////////////////////////////////////////// |
| 158 // BrowserTabStripModelDelegate, private: | 158 // BrowserTabStripModelDelegate, private: |
| 159 | 159 |
| 160 void BrowserTabStripModelDelegate::CloseFrame() { | 160 void BrowserTabStripModelDelegate::CloseFrame() { |
| 161 browser_->window()->Close(); | 161 browser_->window()->Close(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace chrome | 164 } // namespace chrome |
| OLD | NEW |