| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 NavigationEntry* entry = controller_.GetTransientEntry(); | 581 NavigationEntry* entry = controller_.GetTransientEntry(); |
| 582 if (entry) | 582 if (entry) |
| 583 return entry->favicon().bitmap(); | 583 return entry->favicon().bitmap(); |
| 584 | 584 |
| 585 entry = controller_.GetLastCommittedEntry(); | 585 entry = controller_.GetLastCommittedEntry(); |
| 586 if (entry) | 586 if (entry) |
| 587 return entry->favicon().bitmap(); | 587 return entry->favicon().bitmap(); |
| 588 return SkBitmap(); | 588 return SkBitmap(); |
| 589 } | 589 } |
| 590 | 590 |
| 591 bool TabContents::FavIconIsValid() const { | 591 bool TabContents::FaviconIsValid() const { |
| 592 NavigationEntry* entry = controller_.GetTransientEntry(); | 592 NavigationEntry* entry = controller_.GetTransientEntry(); |
| 593 if (entry) | 593 if (entry) |
| 594 return entry->favicon().is_valid(); | 594 return entry->favicon().is_valid(); |
| 595 | 595 |
| 596 entry = controller_.GetLastCommittedEntry(); | 596 entry = controller_.GetLastCommittedEntry(); |
| 597 if (entry) | 597 if (entry) |
| 598 return entry->favicon().is_valid(); | 598 return entry->favicon().is_valid(); |
| 599 | 599 |
| 600 return false; | 600 return false; |
| 601 } | 601 } |
| 602 | 602 |
| 603 bool TabContents::ShouldDisplayFavIcon() { | 603 bool TabContents::ShouldDisplayFavicon() { |
| 604 // Always display a throbber during pending loads. | 604 // Always display a throbber during pending loads. |
| 605 if (controller_.GetLastCommittedEntry() && controller_.pending_entry()) | 605 if (controller_.GetLastCommittedEntry() && controller_.pending_entry()) |
| 606 return true; | 606 return true; |
| 607 | 607 |
| 608 WebUI* web_ui = GetWebUIForCurrentState(); | 608 WebUI* web_ui = GetWebUIForCurrentState(); |
| 609 if (web_ui) | 609 if (web_ui) |
| 610 return !web_ui->hide_favicon(); | 610 return !web_ui->hide_favicon(); |
| 611 return true; | 611 return true; |
| 612 } | 612 } |
| 613 | 613 |
| (...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2817 | 2817 |
| 2818 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2818 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2819 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2819 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2820 rwh_view->SetSize(view()->GetContainerSize()); | 2820 rwh_view->SetSize(view()->GetContainerSize()); |
| 2821 } | 2821 } |
| 2822 | 2822 |
| 2823 void TabContents::OnOnlineStateChanged(bool online) { | 2823 void TabContents::OnOnlineStateChanged(bool online) { |
| 2824 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2824 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
| 2825 render_view_host()->routing_id(), online)); | 2825 render_view_host()->routing_id(), online)); |
| 2826 } | 2826 } |
| OLD | NEW |