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

Side by Side Diff: chrome/browser/resources/offline_pages/offline_internals_browser_proxy.js

Issue 2089423002: [Offline Pages] Connect the offline page logs to the internals page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i4
Patch Set: style update Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @typedef {{ 6 * @typedef {{
7 * onlineUrl: string, 7 * onlineUrl: string,
8 * creationTime: number, 8 * creationTime: number,
9 * id: string, 9 * id: string,
10 * namespace: string, 10 * namespace: string,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 */ 53 */
54 deleteAllPages: function() {}, 54 deleteAllPages: function() {},
55 55
56 /** 56 /**
57 * Deletes a set of pages from stored pages 57 * Deletes a set of pages from stored pages
58 * @param {!Array<string>} ids A list of page IDs to delete. 58 * @param {!Array<string>} ids A list of page IDs to delete.
59 * @return {!Promise<!string>} A promise firing when the selected 59 * @return {!Promise<!string>} A promise firing when the selected
60 * pages are deleted. 60 * pages are deleted.
61 */ 61 */
62 deleteSelectedPages: function(ids) {}, 62 deleteSelectedPages: function(ids) {},
63
64 /**
65 * Sets whether to record logs for stored pages.
66 * @param {boolean} shouldLog True if we should enable logging.
dpapad 2016/06/24 20:33:39 Nit (optional): Avoid using 'we' in comments. "Whe
chili 2016/06/24 21:43:17 Done.
67 */
68 setRecordPageModel: function(shouldLog) {},
69
70 /**
71 * Sets whether to record logs for scheduled requests.
72 * @param {boolean} shouldLog True if we should enable logging.
73 */
74 setRecordRequestQueue: function(shouldLog) {},
75
76 /**
77 * Gets the currently recorded logs.
78 * @return {!Promise<!Array<string>>} A promise firing when the
79 * logs are retrieved.
80 */
81 getEventLogs: function() {},
63 }; 82 };
64 83
65 /** 84 /**
66 * @constructor 85 * @constructor
67 * @implements {offlineInternals.OfflineInternalsBrowserProxy} 86 * @implements {offlineInternals.OfflineInternalsBrowserProxy}
68 */ 87 */
69 function OfflineInternalsBrowserProxyImpl() {} 88 function OfflineInternalsBrowserProxyImpl() {}
70 cr.addSingletonGetter(OfflineInternalsBrowserProxyImpl); 89 cr.addSingletonGetter(OfflineInternalsBrowserProxyImpl);
71 90
72 OfflineInternalsBrowserProxyImpl.prototype = { 91 OfflineInternalsBrowserProxyImpl.prototype = {
73 /** @override */ 92 /** @override */
74 getStoredPages: function() { 93 getStoredPages: function() {
75 return cr.sendWithPromise('getStoredPages'); 94 return cr.sendWithPromise('getStoredPages');
76 }, 95 },
77 96
78 /** @override */ 97 /** @override */
79 getRequestQueue: function() { 98 getRequestQueue: function() {
80 return cr.sendWithPromise('getRequestQueue'); 99 return cr.sendWithPromise('getRequestQueue');
81 }, 100 },
82 101
83 /** @override */ 102 /** @override */
84 deleteAllPages: function() { 103 deleteAllPages: function() {
85 return cr.sendWithPromise('deleteAllPages'); 104 return cr.sendWithPromise('deleteAllPages');
86 }, 105 },
87 106
88 /** @override */ 107 /** @override */
89 deleteSelectedPages: function(ids) { 108 deleteSelectedPages: function(ids) {
90 return cr.sendWithPromise('deleteSelectedPages', ids); 109 return cr.sendWithPromise('deleteSelectedPages', ids);
91 } 110 },
111
112 /** @override */
113 setRecordPageModel: function(shouldLog) {
114 chrome.send('setRecordPageModel');
115 },
116
117 /** @override */
118 setRecordRequestQueue: function(shouldLog) {
119 chrome.send('setRecordRequestQueue');
120 },
121
122 /** @override */
123 getEventLogs: function() {
124 return cr.sendWithPromise('getEventLogs');
125 },
92 }; 126 };
93 127
94 return { 128 return {
95 OfflineInternalsBrowserProxy: OfflineInternalsBrowserProxy, 129 OfflineInternalsBrowserProxy: OfflineInternalsBrowserProxy,
96 OfflineInternalsBrowserProxyImpl: OfflineInternalsBrowserProxyImpl 130 OfflineInternalsBrowserProxyImpl: OfflineInternalsBrowserProxyImpl
97 }; 131 };
98 }); 132 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698