| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 const gfx::Point& p, | 305 const gfx::Point& p, |
| 306 ui::MenuSourceType source_type) { | 306 ui::MenuSourceType source_type) { |
| 307 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); | 307 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); |
| 308 context_menu_contents_->RunMenuAt(p, source_type); | 308 context_menu_contents_->RunMenuAt(p, source_type); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void BrowserTabStripController::UpdateLoadingAnimations() { | 311 void BrowserTabStripController::UpdateLoadingAnimations() { |
| 312 // Don't use the model count here as it's possible for this to be invoked | 312 // Don't use the model count here as it's possible for this to be invoked |
| 313 // before we've applied an update from the model (Browser::TabInsertedAt may | 313 // before we've applied an update from the model (Browser::TabInsertedAt may |
| 314 // be processed before us and invokes this). | 314 // be processed before us and invokes this). |
| 315 for (int i = 0, tab_count = tabstrip_->tab_count(); i < tab_count; ++i) { | 315 for (int i = 0, tab_count = tabstrip_->GetTabCount(); i < tab_count; ++i) { |
| 316 if (model_->ContainsIndex(i)) { | 316 if (model_->ContainsIndex(i)) { |
| 317 Tab* tab = tabstrip_->tab_at(i); | 317 Tab* tab = tabstrip_->tab_at(i); |
| 318 WebContents* contents = model_->GetWebContentsAt(i); | 318 WebContents* contents = model_->GetWebContentsAt(i); |
| 319 tab->UpdateLoadingAnimation(TabContentsNetworkState(contents)); | 319 tab->UpdateLoadingAnimation(TabContentsNetworkState(contents)); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 int BrowserTabStripController::HasAvailableDragActions() const { | 324 int BrowserTabStripController::HasAvailableDragActions() const { |
| 325 return model_->delegate()->GetDragActions(); | 325 return model_->delegate()->GetDragActions(); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 url, | 579 url, |
| 580 mime_type.empty() || | 580 mime_type.empty() || |
| 581 net::IsSupportedMimeType(mime_type) || | 581 net::IsSupportedMimeType(mime_type) || |
| 582 content::PluginService::GetInstance()->GetPluginInfo( | 582 content::PluginService::GetInstance()->GetPluginInfo( |
| 583 -1, // process ID | 583 -1, // process ID |
| 584 MSG_ROUTING_NONE, // routing ID | 584 MSG_ROUTING_NONE, // routing ID |
| 585 model_->profile()->GetResourceContext(), | 585 model_->profile()->GetResourceContext(), |
| 586 url, GURL(), mime_type, false, | 586 url, GURL(), mime_type, false, |
| 587 NULL, &plugin, NULL)); | 587 NULL, &plugin, NULL)); |
| 588 } | 588 } |
| OLD | NEW |