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

Unified Diff: chrome/browser/resources/history/history.js

Issue 1143183002: Proof of concept implementation of context based history filtering. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « chrome/browser/resources/history/history.html ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history/history.js
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index 8cfb2f8174496419691e2fe238fa70be527a07af..707ca5ea5bb1328d669dc9da5acedfe1610f4136 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -128,6 +128,7 @@ function Visit(result, continued, model) {
this.url_ = result.url;
this.domain_ = result.domain;
this.starred_ = result.starred;
+ this.context_ = result.context;
// These identify the name and type of the device on which this visit
// occurred. They will be empty if the visit occurred on the current device.
@@ -858,8 +859,9 @@ HistoryModel.prototype.queryHistory_ = function() {
$('loading-spinner').hidden = false;
this.inFlight_ = true;
+ this.context = $('context-chooser').selectedIndex;
chrome.send('queryHistory',
- [this.searchText_, this.offset_, this.rangeInDays_, endTime, maxResults]);
+ [this.searchText_, this.offset_, this.rangeInDays_, endTime, this.context, maxResults]);
};
/**
@@ -1008,6 +1010,7 @@ function HistoryView(model) {
$('clear-browsing-data').addEventListener('click', openClearBrowsingData);
$('remove-selected').addEventListener('click', removeItems);
+ $('context-chooser').addEventListener('change', onChange);
// Add handlers for the page navigation buttons at the bottom.
$('newest-button').addEventListener('click', function() {
@@ -2147,6 +2150,10 @@ function confirmDeletion(okCallback, cancelCallback) {
showConfirmationOverlay();
}
+function onChange() {
+ historyModel.reload();
+}
+
/**
* Click handler for the 'Remove selected items' button.
* Confirms the deletion with the user, and then deletes the selected visits.
« no previous file with comments | « chrome/browser/resources/history/history.html ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698