summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-24 19:20:01 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-24 19:20:01 +0000
commit9091fb63ab0a815870f6731dd6113e17c59c093e (patch)
tree1d9aa358353355d536e922f38f3450cb4c6cc4d6
parent953937272a6de26b3391058390c5f4e2947e6b0c (diff)
downloadchromium_src-9091fb63ab0a815870f6731dd6113e17c59c093e.zip
chromium_src-9091fb63ab0a815870f6731dd6113e17c59c093e.tar.gz
chromium_src-9091fb63ab0a815870f6731dd6113e17c59c093e.tar.bz2
Remove TopSites dependency from content/ in anticipation of pulling it out of Profile.
(Also remove another BrowserThemeProvider reference) BUG=77155 TEST=compiles Review URL: http://codereview.chromium.org/6733009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79305 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.cc14
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.h3
-rw-r--r--chrome/test/testing_profile.cc4
-rw-r--r--chrome/test/testing_profile.h4
-rw-r--r--content/browser/renderer_host/render_view_host.cc8
-rw-r--r--content/browser/renderer_host/render_view_host.h4
-rw-r--r--content/browser/renderer_host/render_view_host_delegate.h6
-rw-r--r--content/browser/tab_contents/tab_contents.cc13
-rw-r--r--content/browser/tab_contents/tab_contents.h3
9 files changed, 17 insertions, 42 deletions
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
index 4070e32..b5db568e 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h"
#include "chrome/browser/file_select_helper.h"
+#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/password_manager_delegate_impl.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -206,6 +207,7 @@ bool TabContentsWrapper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory)
IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler,
OnRegisterProtocolHandler)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_Thumbnail, OnMsgThumbnail)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -262,6 +264,18 @@ void TabContentsWrapper::OnRegisterProtocolHandler(const std::string& protocol,
}
}
+void TabContentsWrapper::OnMsgThumbnail(const GURL& url,
+ const ThumbnailScore& score,
+ const SkBitmap& bitmap) {
+ if (profile()->IsOffTheRecord())
+ return;
+
+ // Tell History about this thumbnail
+ history::TopSites* ts = profile()->GetTopSites();
+ if (ts)
+ ts->SetPageThumbnail(url, bitmap, score);
+}
+
void TabContentsWrapper::UpdateStarredStateForCurrentURL() {
BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel();
const bool old_state = is_starred_;
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
index d618518..5adcbc2 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
@@ -130,6 +130,9 @@ class TabContentsWrapper : public NotificationObserver,
void OnRegisterProtocolHandler(const std::string& protocol,
const GURL& url,
const string16& title);
+ void OnMsgThumbnail(const GURL& url,
+ const ThumbnailScore& score,
+ const SkBitmap& bitmap);
// Updates the starred state from the bookmark bar model. If the state has
// changed, the delegate is notified.
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index 484d780..551b0a3 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -323,10 +323,6 @@ void TestingProfile::SetTemplateURLModel(TemplateURLModel* model) {
template_url_model_.reset(model);
}
-void TestingProfile::UseThemeProvider(ThemeService* theme_provider) {
- NOTREACHED() << "This needs to go away for a different testing interface.";
-}
-
ExtensionService* TestingProfile::CreateExtensionService(
const CommandLine* command_line,
const FilePath& install_directory) {
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 91d63aa..248ef89 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -113,10 +113,6 @@ class TestingProfile : public Profile {
// Sets the TemplateURLModel. Takes ownership of it.
void SetTemplateURLModel(TemplateURLModel* model);
- // Uses a specific theme provider for this profile. TestingProfile takes
- // ownership of |theme_provider|.
- void UseThemeProvider(ThemeService* theme_provider);
-
// Creates an ExtensionService initialized with the testing profile and
// returns it. The profile keeps its own copy of a scoped_refptr to the
// ExtensionService to make sure that is still alive to be notified when the
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index fec5bf1..011d753 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -28,7 +28,6 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/safebrowsing_messages.h"
-#include "chrome/common/thumbnail_score.h"
#include "chrome/common/translate_errors.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/web_apps.h"
@@ -728,7 +727,6 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTitle, OnMsgUpdateTitle)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateEncoding, OnMsgUpdateEncoding)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnMsgUpdateTargetURL)
- IPC_MESSAGE_HANDLER(ViewHostMsg_Thumbnail, OnMsgThumbnail)
IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnMsgScreenshot)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateInspectorSetting,
OnUpdateInspectorSetting)
@@ -1002,12 +1000,6 @@ void RenderViewHost::OnMsgUpdateTargetURL(int32 page_id,
Send(new ViewMsg_UpdateTargetURL_ACK(routing_id()));
}
-void RenderViewHost::OnMsgThumbnail(const GURL& url,
- const ThumbnailScore& score,
- const SkBitmap& bitmap) {
- delegate_->UpdateThumbnail(url, bitmap, score);
-}
-
void RenderViewHost::OnMsgScreenshot(const SkBitmap& bitmap) {
NotificationService::current()->Notify(
NotificationType::TAB_SNAPSHOT_TAKEN,
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index 3172d84..122cc19 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -40,7 +40,6 @@ class ViewMsg_Navigate;
struct ContentSettings;
struct ContextMenuParams;
struct MediaPlayerAction;
-struct ThumbnailScore;
struct ViewHostMsg_AccessibilityNotification_Params;
struct ViewHostMsg_CreateWindow_Params;
struct ViewHostMsg_DomMessage_Params;
@@ -549,9 +548,6 @@ class RenderViewHost : public RenderWidgetHost {
void OnMsgUpdateTitle(int32 page_id, const std::wstring& title);
void OnMsgUpdateEncoding(const std::string& encoding);
void OnMsgUpdateTargetURL(int32 page_id, const GURL& url);
- void OnMsgThumbnail(const GURL& url,
- const ThumbnailScore& score,
- const SkBitmap& bitmap);
void OnMsgScreenshot(const SkBitmap& bitmap);
void OnMsgClose();
void OnMsgRequestMove(const gfx::Rect& pos);
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index b672618..2b2d6e1 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -45,7 +45,6 @@ class SkBitmap;
class SSLClientAuthHandler;
class SSLAddCertHandler;
class TabContents;
-struct ThumbnailScore;
struct ViewHostMsg_CreateWindow_Params;
struct ViewHostMsg_DomMessage_Params;
struct ViewHostMsg_FrameNavigate_Params;
@@ -446,11 +445,6 @@ class RenderViewHostDelegate : public IPC::Channel::Listener {
// The destination URL has changed should be updated
virtual void UpdateTargetURL(int32 page_id, const GURL& url) {}
- // The thumbnail representation of the page changed and should be updated.
- virtual void UpdateThumbnail(const GURL& url,
- const SkBitmap& bitmap,
- const ThumbnailScore& score) {}
-
// Inspector setting was changed and should be persisted.
virtual void UpdateInspectorSetting(const std::string& key,
const std::string& value) = 0;
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 61bae0c..ee3b627 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -32,7 +32,6 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_types.h"
-#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/load_from_memory_cache_details.h"
#include "chrome/browser/load_notification_details.h"
#include "chrome/browser/metrics/metric_event_duration_details.h"
@@ -2213,18 +2212,6 @@ void TabContents::UpdateTargetURL(int32 page_id, const GURL& url) {
delegate()->UpdateTargetURL(this, url);
}
-void TabContents::UpdateThumbnail(const GURL& url,
- const SkBitmap& bitmap,
- const ThumbnailScore& score) {
- if (profile()->IsOffTheRecord())
- return;
-
- // Tell History about this thumbnail
- history::TopSites* ts = profile()->GetTopSites();
- if (ts)
- ts->SetPageThumbnail(url, bitmap, score);
-}
-
void TabContents::UpdateInspectorSetting(const std::string& key,
const std::string& value) {
RenderViewHostDelegateHelper::UpdateInspectorSetting(profile(), key, value);
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index efac700..d0eb864 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -907,9 +907,6 @@ class TabContents : public PageNavigator,
virtual void UpdateEncoding(RenderViewHost* render_view_host,
const std::string& encoding);
virtual void UpdateTargetURL(int32 page_id, const GURL& url);
- virtual void UpdateThumbnail(const GURL& url,
- const SkBitmap& bitmap,
- const ThumbnailScore& score);
virtual void UpdateInspectorSetting(const std::string& key,
const std::string& value);
virtual void ClearInspectorSettings();