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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 TabContents* tab_contents = TabContents::FromWebContents(contents); | 510 TabContents* tab_contents = TabContents::FromWebContents(contents); |
511 | 511 |
512 data->favicon = tab_contents->favicon_tab_helper()->GetFavicon(); | 512 // TODO: Convert data->favicon to gfx::Image. |
| 513 data->favicon = |
| 514 tab_contents->favicon_tab_helper()->GetFavicon().AsBitmap(); |
513 data->network_state = TabContentsNetworkState(contents); | 515 data->network_state = TabContentsNetworkState(contents); |
514 data->title = contents->GetTitle(); | 516 data->title = contents->GetTitle(); |
515 data->url = contents->GetURL(); | 517 data->url = contents->GetURL(); |
516 data->loading = contents->IsLoading(); | 518 data->loading = contents->IsLoading(); |
517 data->crashed_status = contents->GetCrashedStatus(); | 519 data->crashed_status = contents->GetCrashedStatus(); |
518 data->incognito = contents->GetBrowserContext()->IsOffTheRecord(); | 520 data->incognito = contents->GetBrowserContext()->IsOffTheRecord(); |
519 data->show_icon = tab_contents->favicon_tab_helper()->ShouldDisplayFavicon(); | 521 data->show_icon = tab_contents->favicon_tab_helper()->ShouldDisplayFavicon(); |
520 data->mini = model_->IsMiniTab(model_index); | 522 data->mini = model_->IsMiniTab(model_index); |
521 data->blocked = model_->IsTabBlocked(model_index); | 523 data->blocked = model_->IsTabBlocked(model_index); |
522 data->app = tab_contents->extension_tab_helper()->is_app(); | 524 data->app = tab_contents->extension_tab_helper()->is_app(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); | 583 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); |
582 tabstrip_->AddTabAt(index, data, is_active); | 584 tabstrip_->AddTabAt(index, data, is_active); |
583 } | 585 } |
584 | 586 |
585 void BrowserTabStripController::UpdateLayoutType() { | 587 void BrowserTabStripController::UpdateLayoutType() { |
586 bool adjust_layout = false; | 588 bool adjust_layout = false; |
587 TabStripLayoutType layout_type = | 589 TabStripLayoutType layout_type = |
588 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); | 590 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); |
589 tabstrip_->SetLayoutType(layout_type, adjust_layout); | 591 tabstrip_->SetLayoutType(layout_type, adjust_layout); |
590 } | 592 } |
OLD | NEW |