Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 12377095: Add "clear" to about://instant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 void InstantController::LogDebugEvent(const std::string& info) const { 839 void InstantController::LogDebugEvent(const std::string& info) const {
840 DVLOG(1) << info; 840 DVLOG(1) << info;
841 841
842 debug_events_.push_front(std::make_pair( 842 debug_events_.push_front(std::make_pair(
843 base::Time::Now().ToInternalValue(), info)); 843 base::Time::Now().ToInternalValue(), info));
844 static const size_t kMaxDebugEventSize = 2000; 844 static const size_t kMaxDebugEventSize = 2000;
845 if (debug_events_.size() > kMaxDebugEventSize) 845 if (debug_events_.size() > kMaxDebugEventSize)
846 debug_events_.pop_back(); 846 debug_events_.pop_back();
847 } 847 }
848 848
849 void InstantController::ClearDebugEvents() {
850 debug_events_.clear();
851 }
852
849 void InstantController::DeleteMostVisitedItem(const GURL& url) { 853 void InstantController::DeleteMostVisitedItem(const GURL& url) {
850 history::TopSites* top_sites = browser_->profile()->GetTopSites(); 854 history::TopSites* top_sites = browser_->profile()->GetTopSites();
851 if (!top_sites) 855 if (!top_sites)
852 return; 856 return;
853 857
854 top_sites->AddBlacklistedURL(url); 858 top_sites->AddBlacklistedURL(url);
855 } 859 }
856 860
857 void InstantController::UndoMostVisitedDeletion(const GURL& url) { 861 void InstantController::UndoMostVisitedDeletion(const GURL& url) {
858 history::TopSites* top_sites = browser_->profile()->GetTopSites(); 862 history::TopSites* top_sites = browser_->profile()->GetTopSites();
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 overlay_->SendMostVisitedItems(items); 1519 overlay_->SendMostVisitedItems(items);
1516 if (ntp_) 1520 if (ntp_)
1517 ntp_->SendMostVisitedItems(items); 1521 ntp_->SendMostVisitedItems(items);
1518 if (instant_tab_) 1522 if (instant_tab_)
1519 instant_tab_->SendMostVisitedItems(items); 1523 instant_tab_->SendMostVisitedItems(items);
1520 content::NotificationService::current()->Notify( 1524 content::NotificationService::current()->Notify(
1521 chrome::NOTIFICATION_INSTANT_SENT_MOST_VISITED_ITEMS, 1525 chrome::NOTIFICATION_INSTANT_SENT_MOST_VISITED_ITEMS,
1522 content::Source<InstantController>(this), 1526 content::Source<InstantController>(this),
1523 content::NotificationService::NoDetails()); 1527 content::NotificationService::NoDetails());
1524 } 1528 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/resources/instant/instant.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698