| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2693 delegate()->UpdateTargetURL(this, url); | 2693 delegate()->UpdateTargetURL(this, url); |
| 2694 } | 2694 } |
| 2695 | 2695 |
| 2696 void TabContents::UpdateThumbnail(const GURL& url, | 2696 void TabContents::UpdateThumbnail(const GURL& url, |
| 2697 const SkBitmap& bitmap, | 2697 const SkBitmap& bitmap, |
| 2698 const ThumbnailScore& score) { | 2698 const ThumbnailScore& score) { |
| 2699 if (profile()->IsOffTheRecord()) | 2699 if (profile()->IsOffTheRecord()) |
| 2700 return; | 2700 return; |
| 2701 | 2701 |
| 2702 // Tell History about this thumbnail | 2702 // Tell History about this thumbnail |
| 2703 if (history::TopSites::IsEnabled()) { | 2703 history::TopSites* ts = profile()->GetTopSites(); |
| 2704 history::TopSites* ts = profile()->GetTopSites(); | 2704 if (ts) |
| 2705 if (ts) | 2705 ts->SetPageThumbnail(url, bitmap, score); |
| 2706 ts->SetPageThumbnail(url, bitmap, score); | |
| 2707 } else { | |
| 2708 HistoryService* hs = | |
| 2709 profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); | |
| 2710 if (hs) | |
| 2711 hs->SetPageThumbnail(url, bitmap, score); | |
| 2712 } | |
| 2713 } | 2706 } |
| 2714 | 2707 |
| 2715 void TabContents::UpdateInspectorSetting(const std::string& key, | 2708 void TabContents::UpdateInspectorSetting(const std::string& key, |
| 2716 const std::string& value) { | 2709 const std::string& value) { |
| 2717 RenderViewHostDelegateHelper::UpdateInspectorSetting(profile(), key, value); | 2710 RenderViewHostDelegateHelper::UpdateInspectorSetting(profile(), key, value); |
| 2718 } | 2711 } |
| 2719 | 2712 |
| 2720 void TabContents::ClearInspectorSettings() { | 2713 void TabContents::ClearInspectorSettings() { |
| 2721 RenderViewHostDelegateHelper::ClearInspectorSettings(profile()); | 2714 RenderViewHostDelegateHelper::ClearInspectorSettings(profile()); |
| 2722 } | 2715 } |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3363 } | 3356 } |
| 3364 | 3357 |
| 3365 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 3358 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
| 3366 render_manager_.SwapInRenderViewHost(rvh); | 3359 render_manager_.SwapInRenderViewHost(rvh); |
| 3367 } | 3360 } |
| 3368 | 3361 |
| 3369 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3362 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 3370 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 3363 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 3371 rwh_view->SetSize(view()->GetContainerSize()); | 3364 rwh_view->SetSize(view()->GetContainerSize()); |
| 3372 } | 3365 } |
| OLD | NEW |