summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 03:24:49 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 03:24:49 +0000
commit2ec53b5e7018ed63499e0a4fab557f820b03fc53 (patch)
tree3a38d3a7c52cf844cd1d1cf5867e1af18330397e /chrome/browser/dom_ui
parent18d4b6cecb490ffa3dcb53cfad7ca0ad695217c4 (diff)
downloadchromium_src-2ec53b5e7018ed63499e0a4fab557f820b03fc53.zip
chromium_src-2ec53b5e7018ed63499e0a4fab557f820b03fc53.tar.gz
chromium_src-2ec53b5e7018ed63499e0a4fab557f820b03fc53.tar.bz2
Disables top sites until we get it in a better shape.
BUG=40313 TEST=see bug. aocampo has some test cases too. Review URL: http://codereview.chromium.org/3412015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/dom_ui_thumbnail_source.cc6
-rw-r--r--chrome/browser/dom_ui/most_visited_handler.cc14
2 files changed, 9 insertions, 11 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc b/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
index ebff335..f17586f 100644
--- a/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_thumbnail_source.cc
@@ -6,10 +6,8 @@
#include "app/resource_bundle.h"
#include "base/callback.h"
-#include "base/command_line.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/history/top_sites.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/url_constants.h"
#include "gfx/codec/jpeg_codec.h"
@@ -28,7 +26,7 @@ DOMUIThumbnailSource::~DOMUIThumbnailSource() {
void DOMUIThumbnailSource::StartDataRequest(const std::string& path,
bool is_off_the_record,
int request_id) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
history::TopSites* top_sites = profile_->GetTopSites();
RefCountedBytes* data = NULL;
if (top_sites->GetPageThumbnail(GURL(path), &data)) {
@@ -38,7 +36,7 @@ void DOMUIThumbnailSource::StartDataRequest(const std::string& path,
SendDefaultThumbnail(request_id);
}
return;
- } // end --top-sites switch
+ }
HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
if (hs) {
diff --git a/chrome/browser/dom_ui/most_visited_handler.cc b/chrome/browser/dom_ui/most_visited_handler.cc
index 3542198..95d326f 100644
--- a/chrome/browser/dom_ui/most_visited_handler.cc
+++ b/chrome/browser/dom_ui/most_visited_handler.cc
@@ -144,7 +144,7 @@ void MostVisitedHandler::SendPagesValue() {
}
void MostVisitedHandler::StartQueryForMostVisited() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
// Use TopSites.
history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites();
ts->GetMostVisitedURLs(
@@ -189,7 +189,7 @@ void MostVisitedHandler::HandleRemoveURLsFromBlacklist(const ListValue* args) {
}
UserMetrics::RecordAction(UserMetricsAction("MostVisited_UrlRemoved"),
dom_ui_->GetProfile());
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites();
ts->RemoveBlacklistedURL(GURL(url));
return;
@@ -204,7 +204,7 @@ void MostVisitedHandler::HandleClearBlacklist(const ListValue* args) {
UserMetrics::RecordAction(UserMetricsAction("MostVisited_BlacklistCleared"),
dom_ui_->GetProfile());
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites();
ts->ClearBlacklistedURLs();
return;
@@ -248,7 +248,7 @@ void MostVisitedHandler::HandleAddPinnedURL(const ListValue* args) {
}
void MostVisitedHandler::AddPinnedURL(const MostVisitedPage& page, int index) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites();
ts->AddPinnedURL(page.url, index);
return;
@@ -277,7 +277,7 @@ void MostVisitedHandler::HandleRemovePinnedURL(const ListValue* args) {
}
void MostVisitedHandler::RemovePinnedURL(const GURL& url) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites();
ts->RemovePinnedURL(url);
return;
@@ -410,7 +410,7 @@ void MostVisitedHandler::SetPagesValue(std::vector<PageUsageData*>* data) {
void MostVisitedHandler::SetPagesValueFromTopSites(
const history::MostVisitedURLList& data) {
- DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites));
+ DCHECK(history::TopSites::IsEnabled());
pages_value_.reset(new ListValue);
for (size_t i = 0; i < data.size(); i++) {
const history::MostVisitedURL& url = data[i];
@@ -512,7 +512,7 @@ void MostVisitedHandler::Observe(NotificationType type,
}
void MostVisitedHandler::BlacklistURL(const GURL& url) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTopSites)) {
+ if (history::TopSites::IsEnabled()) {
history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites();
ts->AddBlacklistedURL(url);
return;