OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |