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

Unified Diff: chrome/common/extensions/docs/examples/api/history/showHistoryFilter/historyFilterUrls.js

Issue 25389003: [DocServer] Updated Top Sites Sample Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added new icon Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/history/showHistoryFilter/historyFilterUrls.js
diff --git a/chrome/common/extensions/docs/examples/api/history/showHistoryFilter/historyFilterUrls.js b/chrome/common/extensions/docs/examples/api/history/showHistoryFilter/historyFilterUrls.js
deleted file mode 100644
index 1b48f5ef0c774b24e1b9227138ead4e9021a0df0..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/docs/examples/api/history/showHistoryFilter/historyFilterUrls.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Event listner for clicks on links in a browser action popup.
-// Open the link in a new tab of the current window.
-function onAnchorClick(event) {
- chrome.tabs.create({
- selected: true,
- url: event.srcElement.href
- });
- return false;
-}
-
-// Given an array of URLs, build a DOM list of those URLs in the
-// browser action popup.
-function buildPopupDom(divName, data) {
- var popupDiv = document.getElementById(divName);
-
- var ul = document.createElement('ul');
- popupDiv.appendChild(ul);
-
- for (var i = 0, ie = data.length; i < ie; ++i) {
- var a = document.createElement('a');
- a.href = data[i].url;
- a.appendChild(document.createTextNode(data[i].title));
- a.addEventListener('click', onAnchorClick);
-
- var li = document.createElement('li');
- li.appendChild(a);
-
- ul.appendChild(li);
- }
-}
-
-// Search history to find up to ten links that a user has visited during the
-// current time of the day +/- 1 hour.
-function buildTypedUrlList(divName) {
- var millisecondsPerHour = 1000 * 60 * 60;
- var maxResults = 10;
-
- chrome.experimental.history.getMostVisited({
- 'filterWidth' : millisecondsPerHour,
- 'maxResults' : maxResults
- },
- function(historyItems) {
- buildPopupDom(divName, historyItems);
- }
- );
-}
-
-document.addEventListener('DOMContentLoaded', function () {
- buildTypedUrlList("filteredUrl_div");
-});

Powered by Google App Engine
This is Rietveld 408576698