| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/ui/webui/ntp/most_visited_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 MostVisitedHandler::~MostVisitedHandler() { | 57 MostVisitedHandler::~MostVisitedHandler() { |
| 58 if (!user_action_logged_ && most_visited_viewed_) { | 58 if (!user_action_logged_ && most_visited_viewed_) { |
| 59 const GURL ntp_url = GURL(chrome::kChromeUINewTabURL); | 59 const GURL ntp_url = GURL(chrome::kChromeUINewTabURL); |
| 60 int action_id = NTP_FOLLOW_ACTION_OTHER; | 60 int action_id = NTP_FOLLOW_ACTION_OTHER; |
| 61 content::NavigationEntry* entry = | 61 content::NavigationEntry* entry = |
| 62 web_ui()->GetWebContents()->GetController().GetLastCommittedEntry(); | 62 web_ui()->GetWebContents()->GetController().GetLastCommittedEntry(); |
| 63 if (entry && (entry->GetURL() != ntp_url)) { | 63 if (entry && (entry->GetURL() != ntp_url)) { |
| 64 action_id = | 64 action_id = |
| 65 content::PageTransitionStripQualifier(entry->GetTransitionType()); | 65 ui::PageTransitionStripQualifier(entry->GetTransitionType()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 UMA_HISTOGRAM_ENUMERATION("NewTabPage.MostVisitedAction", action_id, | 68 UMA_HISTOGRAM_ENUMERATION("NewTabPage.MostVisitedAction", action_id, |
| 69 NUM_NTP_FOLLOW_ACTIONS); | 69 NUM_NTP_FOLLOW_ACTIONS); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 void MostVisitedHandler::RegisterMessages() { | 73 void MostVisitedHandler::RegisterMessages() { |
| 74 Profile* profile = Profile::FromWebUI(web_ui()); | 74 Profile* profile = Profile::FromWebUI(web_ui()); |
| 75 // Set up our sources for thumbnail and favicon data. | 75 // Set up our sources for thumbnail and favicon data. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 return base::MD5String(url); | 259 return base::MD5String(url); |
| 260 } | 260 } |
| 261 | 261 |
| 262 // static | 262 // static |
| 263 void MostVisitedHandler::RegisterProfilePrefs( | 263 void MostVisitedHandler::RegisterProfilePrefs( |
| 264 user_prefs::PrefRegistrySyncable* registry) { | 264 user_prefs::PrefRegistrySyncable* registry) { |
| 265 registry->RegisterDictionaryPref( | 265 registry->RegisterDictionaryPref( |
| 266 prefs::kNtpMostVisitedURLsBlacklist, | 266 prefs::kNtpMostVisitedURLsBlacklist, |
| 267 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 267 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 268 } | 268 } |
| OLD | NEW |