Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: chrome/browser/ui/browser_tab_strip_model_delegate.cc

Issue 1931793002: Stop using nested message loop for alert() and other JS dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments and removed unused declaration Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/fast_unload_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // We only create historical tab entries for tabbed browser windows. 119 // We only create historical tab entries for tabbed browser windows.
120 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { 120 if (service && browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) {
121 service->CreateHistoricalTab( 121 service->CreateHistoricalTab(
122 sessions::ContentLiveTab::GetForWebContents(contents), 122 sessions::ContentLiveTab::GetForWebContents(contents),
123 browser_->tab_strip_model()->GetIndexOfWebContents(contents)); 123 browser_->tab_strip_model()->GetIndexOfWebContents(contents));
124 } 124 }
125 } 125 }
126 126
127 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing( 127 bool BrowserTabStripModelDelegate::RunUnloadListenerBeforeClosing(
128 content::WebContents* contents) { 128 content::WebContents* contents) {
129 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 129 return browser_->RunUnloadListenerBeforeClosing(contents);
130 switches::kEnableFastUnload)) {
131 return chrome::FastUnloadController::RunUnloadEventsHelper(contents);
132 }
133 return chrome::UnloadController::RunUnloadEventsHelper(contents);
134 } 130 }
135 131
136 bool BrowserTabStripModelDelegate::ShouldRunUnloadListenerBeforeClosing( 132 bool BrowserTabStripModelDelegate::ShouldRunUnloadListenerBeforeClosing(
137 content::WebContents* contents) { 133 content::WebContents* contents) {
138 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 134 return browser_->ShouldRunUnloadListenerBeforeClosing(contents);
139 switches::kEnableFastUnload)) {
140 return chrome::FastUnloadController::ShouldRunUnloadEventsHelper(contents);
141 }
142 return chrome::UnloadController::ShouldRunUnloadEventsHelper(contents);
143 } 135 }
144 136
145 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const { 137 bool BrowserTabStripModelDelegate::CanBookmarkAllTabs() const {
146 return chrome::CanBookmarkAllTabs(browser_); 138 return chrome::CanBookmarkAllTabs(browser_);
147 } 139 }
148 140
149 void BrowserTabStripModelDelegate::BookmarkAllTabs() { 141 void BrowserTabStripModelDelegate::BookmarkAllTabs() {
150 chrome::BookmarkAllTabs(browser_); 142 chrome::BookmarkAllTabs(browser_);
151 } 143 }
152 144
153 TabStripModelDelegate::RestoreTabType 145 TabStripModelDelegate::RestoreTabType
154 BrowserTabStripModelDelegate::GetRestoreTabType() { 146 BrowserTabStripModelDelegate::GetRestoreTabType() {
155 return chrome::GetRestoreTabType(browser_); 147 return chrome::GetRestoreTabType(browser_);
156 } 148 }
157 149
158 void BrowserTabStripModelDelegate::RestoreTab() { 150 void BrowserTabStripModelDelegate::RestoreTab() {
159 chrome::RestoreTab(browser_); 151 chrome::RestoreTab(browser_);
160 } 152 }
161 153
162 //////////////////////////////////////////////////////////////////////////////// 154 ////////////////////////////////////////////////////////////////////////////////
163 // BrowserTabStripModelDelegate, private: 155 // BrowserTabStripModelDelegate, private:
164 156
165 void BrowserTabStripModelDelegate::CloseFrame() { 157 void BrowserTabStripModelDelegate::CloseFrame() {
166 browser_->window()->Close(); 158 browser_->window()->Close();
167 } 159 }
168 160
169 } // namespace chrome 161 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/fast_unload_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698