| 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/views/tabs/browser_tab_strip_controller.h" | 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 CloseTabSource source) { | 293 CloseTabSource source) { |
| 294 // Cancel any pending tab transition. | 294 // Cancel any pending tab transition. |
| 295 hover_tab_selector_.CancelTabTransition(); | 295 hover_tab_selector_.CancelTabTransition(); |
| 296 | 296 |
| 297 tabstrip_->PrepareForCloseAt(model_index, source); | 297 tabstrip_->PrepareForCloseAt(model_index, source); |
| 298 model_->CloseWebContentsAt(model_index, | 298 model_->CloseWebContentsAt(model_index, |
| 299 TabStripModel::CLOSE_USER_GESTURE | | 299 TabStripModel::CLOSE_USER_GESTURE | |
| 300 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); | 300 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void BrowserTabStripController::ToggleTabAudioMute(int model_index) { |
| 304 content::WebContents* const contents = model_->GetWebContentsAt(model_index); |
| 305 chrome::SetTabAudioMuted(contents, !chrome::IsTabAudioMuted(contents)); |
| 306 } |
| 307 |
| 303 void BrowserTabStripController::ShowContextMenuForTab( | 308 void BrowserTabStripController::ShowContextMenuForTab( |
| 304 Tab* tab, | 309 Tab* tab, |
| 305 const gfx::Point& p, | 310 const gfx::Point& p, |
| 306 ui::MenuSourceType source_type) { | 311 ui::MenuSourceType source_type) { |
| 307 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); | 312 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); |
| 308 context_menu_contents_->RunMenuAt(p, source_type); | 313 context_menu_contents_->RunMenuAt(p, source_type); |
| 309 } | 314 } |
| 310 | 315 |
| 311 void BrowserTabStripController::UpdateLoadingAnimations() { | 316 void BrowserTabStripController::UpdateLoadingAnimations() { |
| 312 // Don't use the model count here as it's possible for this to be invoked | 317 // Don't use the model count here as it's possible for this to be invoked |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 url, | 584 url, |
| 580 mime_type.empty() || | 585 mime_type.empty() || |
| 581 net::IsSupportedMimeType(mime_type) || | 586 net::IsSupportedMimeType(mime_type) || |
| 582 content::PluginService::GetInstance()->GetPluginInfo( | 587 content::PluginService::GetInstance()->GetPluginInfo( |
| 583 -1, // process ID | 588 -1, // process ID |
| 584 MSG_ROUTING_NONE, // routing ID | 589 MSG_ROUTING_NONE, // routing ID |
| 585 model_->profile()->GetResourceContext(), | 590 model_->profile()->GetResourceContext(), |
| 586 url, GURL(), mime_type, false, | 591 url, GURL(), mime_type, false, |
| 587 NULL, &plugin, NULL)); | 592 NULL, &plugin, NULL)); |
| 588 } | 593 } |
| OLD | NEW |