| 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 NOTREACHED(); | 500 NOTREACHED(); |
| 501 break; | 501 break; |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 | 504 |
| 505 void BrowserTabStripController::SetTabRendererDataFromModel( | 505 void BrowserTabStripController::SetTabRendererDataFromModel( |
| 506 WebContents* contents, | 506 WebContents* contents, |
| 507 int model_index, | 507 int model_index, |
| 508 TabRendererData* data, | 508 TabRendererData* data, |
| 509 TabStatus tab_status) { | 509 TabStatus tab_status) { |
| 510 SkBitmap* app_icon = NULL; | |
| 511 TabContents* tab_contents = TabContents::FromWebContents(contents); | 510 TabContents* tab_contents = TabContents::FromWebContents(contents); |
| 512 | 511 |
| 513 if (app_icon) | 512 data->favicon = tab_contents->favicon_tab_helper()->GetFavicon(); |
| 514 data->favicon = *app_icon; | |
| 515 else | |
| 516 data->favicon = tab_contents->favicon_tab_helper()->GetFavicon(); | |
| 517 data->network_state = TabContentsNetworkState(contents); | 513 data->network_state = TabContentsNetworkState(contents); |
| 518 data->title = contents->GetTitle(); | 514 data->title = contents->GetTitle(); |
| 519 data->url = contents->GetURL(); | 515 data->url = contents->GetURL(); |
| 520 data->loading = contents->IsLoading(); | 516 data->loading = contents->IsLoading(); |
| 521 data->crashed_status = contents->GetCrashedStatus(); | 517 data->crashed_status = contents->GetCrashedStatus(); |
| 522 data->incognito = contents->GetBrowserContext()->IsOffTheRecord(); | 518 data->incognito = contents->GetBrowserContext()->IsOffTheRecord(); |
| 523 data->show_icon = tab_contents->favicon_tab_helper()->ShouldDisplayFavicon(); | 519 data->show_icon = tab_contents->favicon_tab_helper()->ShouldDisplayFavicon(); |
| 524 data->mini = model_->IsMiniTab(model_index); | 520 data->mini = model_->IsMiniTab(model_index); |
| 525 data->blocked = model_->IsTabBlocked(model_index); | 521 data->blocked = model_->IsTabBlocked(model_index); |
| 526 data->app = tab_contents->extension_tab_helper()->is_app(); | 522 data->app = tab_contents->extension_tab_helper()->is_app(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); | 581 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); |
| 586 tabstrip_->AddTabAt(index, data, is_active); | 582 tabstrip_->AddTabAt(index, data, is_active); |
| 587 } | 583 } |
| 588 | 584 |
| 589 void BrowserTabStripController::UpdateLayoutType() { | 585 void BrowserTabStripController::UpdateLayoutType() { |
| 590 bool adjust_layout = false; | 586 bool adjust_layout = false; |
| 591 TabStripLayoutType layout_type = | 587 TabStripLayoutType layout_type = |
| 592 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); | 588 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); |
| 593 tabstrip_->SetLayoutType(layout_type, adjust_layout); | 589 tabstrip_->SetLayoutType(layout_type, adjust_layout); |
| 594 } | 590 } |
| OLD | NEW |