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