| 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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 Profile::IMPLICIT_ACCESS); | 839 Profile::IMPLICIT_ACCESS); |
| 840 if (!service) | 840 if (!service) |
| 841 return; | 841 return; |
| 842 const NavigationEntry::FaviconStatus& favicon(entry->favicon()); | 842 const NavigationEntry::FaviconStatus& favicon(entry->favicon()); |
| 843 if (!favicon.is_valid() || favicon.url().is_empty() || | 843 if (!favicon.is_valid() || favicon.url().is_empty() || |
| 844 favicon.bitmap().empty()) { | 844 favicon.bitmap().empty()) { |
| 845 return; | 845 return; |
| 846 } | 846 } |
| 847 std::vector<unsigned char> image_data; | 847 std::vector<unsigned char> image_data; |
| 848 gfx::PNGCodec::EncodeBGRASkBitmap(favicon.bitmap(), false, &image_data); | 848 gfx::PNGCodec::EncodeBGRASkBitmap(favicon.bitmap(), false, &image_data); |
| 849 service->SetFavicon(entry->url(), favicon.url(), image_data); | 849 service->SetFavicon( |
| 850 entry->url(), favicon.url(), image_data, history::FAVICON); |
| 850 } | 851 } |
| 851 | 852 |
| 852 ConstrainedWindow* TabContents::CreateConstrainedDialog( | 853 ConstrainedWindow* TabContents::CreateConstrainedDialog( |
| 853 ConstrainedWindowDelegate* delegate) { | 854 ConstrainedWindowDelegate* delegate) { |
| 854 ConstrainedWindow* window = | 855 ConstrainedWindow* window = |
| 855 ConstrainedWindow::CreateConstrainedDialog(this, delegate); | 856 ConstrainedWindow::CreateConstrainedDialog(this, delegate); |
| 856 AddConstrainedDialog(window); | 857 AddConstrainedDialog(window); |
| 857 return window; | 858 return window; |
| 858 } | 859 } |
| 859 | 860 |
| (...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2817 | 2818 |
| 2818 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2819 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2819 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2820 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2820 rwh_view->SetSize(view()->GetContainerSize()); | 2821 rwh_view->SetSize(view()->GetContainerSize()); |
| 2821 } | 2822 } |
| 2822 | 2823 |
| 2823 void TabContents::OnOnlineStateChanged(bool online) { | 2824 void TabContents::OnOnlineStateChanged(bool online) { |
| 2824 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2825 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
| 2825 render_view_host()->routing_id(), online)); | 2826 render_view_host()->routing_id(), online)); |
| 2826 } | 2827 } |
| OLD | NEW |