| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 NOTREACHED(); | 505 NOTREACHED(); |
| 506 break; | 506 break; |
| 507 } | 507 } |
| 508 } | 508 } |
| 509 | 509 |
| 510 void BrowserTabStripController::SetTabRendererDataFromModel( | 510 void BrowserTabStripController::SetTabRendererDataFromModel( |
| 511 WebContents* contents, | 511 WebContents* contents, |
| 512 int model_index, | 512 int model_index, |
| 513 TabRendererData* data, | 513 TabRendererData* data, |
| 514 TabStatus tab_status) { | 514 TabStatus tab_status) { |
| 515 TabContents* tab_contents = TabContents::FromWebContents(contents); | 515 FaviconTabHelper* favicon_tab_helper = |
| 516 FaviconTabHelper::FromWebContents(contents); |
| 516 | 517 |
| 517 data->favicon = | 518 data->favicon = favicon_tab_helper->GetFavicon().AsImageSkia(); |
| 518 tab_contents->favicon_tab_helper()->GetFavicon().AsImageSkia(); | |
| 519 data->network_state = TabContentsNetworkState(contents); | 519 data->network_state = TabContentsNetworkState(contents); |
| 520 data->title = contents->GetTitle(); | 520 data->title = contents->GetTitle(); |
| 521 data->url = contents->GetURL(); | 521 data->url = contents->GetURL(); |
| 522 data->loading = contents->IsLoading(); | 522 data->loading = contents->IsLoading(); |
| 523 data->crashed_status = contents->GetCrashedStatus(); | 523 data->crashed_status = contents->GetCrashedStatus(); |
| 524 data->incognito = contents->GetBrowserContext()->IsOffTheRecord(); | 524 data->incognito = contents->GetBrowserContext()->IsOffTheRecord(); |
| 525 data->show_icon = tab_contents->favicon_tab_helper()->ShouldDisplayFavicon(); | 525 data->show_icon = favicon_tab_helper->ShouldDisplayFavicon(); |
| 526 data->mini = model_->IsMiniTab(model_index); | 526 data->mini = model_->IsMiniTab(model_index); |
| 527 data->blocked = model_->IsTabBlocked(model_index); | 527 data->blocked = model_->IsTabBlocked(model_index); |
| 528 data->app = extensions::TabHelper::FromWebContents(contents)->is_app(); | 528 data->app = extensions::TabHelper::FromWebContents(contents)->is_app(); |
| 529 data->mode = browser_->search_model()->mode().mode; | 529 data->mode = browser_->search_model()->mode().mode; |
| 530 // Get current gradient background animation to paint. | 530 // Get current gradient background animation to paint. |
| 531 data->gradient_background_opacity = browser_->search_delegate()-> | 531 data->gradient_background_opacity = browser_->search_delegate()-> |
| 532 toolbar_search_animator().GetGradientOpacity(); | 532 toolbar_search_animator().GetGradientOpacity(); |
| 533 } | 533 } |
| 534 | 534 |
| 535 void BrowserTabStripController::SetTabDataAt(content::WebContents* web_contents, | 535 void BrowserTabStripController::SetTabDataAt(content::WebContents* web_contents, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); | 576 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); |
| 577 tabstrip_->AddTabAt(index, data, is_active); | 577 tabstrip_->AddTabAt(index, data, is_active); |
| 578 } | 578 } |
| 579 | 579 |
| 580 void BrowserTabStripController::UpdateLayoutType() { | 580 void BrowserTabStripController::UpdateLayoutType() { |
| 581 bool adjust_layout = false; | 581 bool adjust_layout = false; |
| 582 TabStripLayoutType layout_type = | 582 TabStripLayoutType layout_type = |
| 583 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); | 583 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); |
| 584 tabstrip_->SetLayoutType(layout_type, adjust_layout); | 584 tabstrip_->SetLayoutType(layout_type, adjust_layout); |
| 585 } | 585 } |
| OLD | NEW |