OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/dom_ui/new_tab_ui.h" | 7 #include "chrome/browser/dom_ui/new_tab_ui.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 NewTabUI::AddRecentlyClosedEntries(service->entries(), &list_value); | 152 NewTabUI::AddRecentlyClosedEntries(service->entries(), &list_value); |
153 | 153 |
154 dom_ui_->CallJavascriptFunction(L"recentlyClosedTabs", list_value); | 154 dom_ui_->CallJavascriptFunction(L"recentlyClosedTabs", list_value); |
155 } | 155 } |
156 | 156 |
157 void RecentlyClosedTabsHandler::TabRestoreServiceDestroyed( | 157 void RecentlyClosedTabsHandler::TabRestoreServiceDestroyed( |
158 TabRestoreService* service) { | 158 TabRestoreService* service) { |
159 tab_restore_service_ = NULL; | 159 tab_restore_service_ = NULL; |
160 } | 160 } |
161 | 161 |
162 | |
163 /////////////////////////////////////////////////////////////////////////////// | 162 /////////////////////////////////////////////////////////////////////////////// |
164 // MetricsHandler | 163 // MetricsHandler |
165 | 164 |
166 // Let the page contents record UMA actions. Only use when you can't do it from | 165 // Let the page contents record UMA actions. Only use when you can't do it from |
167 // C++. For example, we currently use it to let the NTP log the postion of the | 166 // C++. For example, we currently use it to let the NTP log the postion of the |
168 // Most Visited or Bookmark the user clicked on, as we don't get that | 167 // Most Visited or Bookmark the user clicked on, as we don't get that |
169 // information through RequestOpenURL. You will need to update the metrics | 168 // information through RequestOpenURL. You will need to update the metrics |
170 // dashboard with the action names you use, as our processor won't catch that | 169 // dashboard with the action names you use, as our processor won't catch that |
171 // information (treat it as RecordComputedMetrics) | 170 // information (treat it as RecordComputedMetrics) |
172 class MetricsHandler : public DOMMessageHandler { | 171 class MetricsHandler : public DOMMessageHandler { |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 591 |
593 scoped_refptr<RefCountedBytes> html_bytes( | 592 scoped_refptr<RefCountedBytes> html_bytes( |
594 profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record)); | 593 profile_->GetNTPResourceCache()->GetNewTabHTML(is_off_the_record)); |
595 | 594 |
596 SendResponse(request_id, html_bytes); | 595 SendResponse(request_id, html_bytes); |
597 } | 596 } |
598 | 597 |
599 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 598 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
600 return "text/html"; | 599 return "text/html"; |
601 } | 600 } |
OLD | NEW |