Commit f53a4eeb authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

Remove google analytics entirely.

This CL removes the last remaining traces of GA from files app.

It does not replace the remaining metrics that were being recorded
with UMAs, we're removing them as well as either:
a) There's coverage via an existing UMA, or
b) We don't care to record that metric anymore.

Bug: 847729
Change-Id: I602de642bac43df64f1ecd9035314d5019268aa8
Reviewed-on: https://chromium-review.googlesource.com/c/1347648Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610317}
parent 606aacfb
...@@ -13,8 +13,5 @@ var FileBrowserBackground = function() {}; ...@@ -13,8 +13,5 @@ var FileBrowserBackground = function() {};
*/ */
FileBrowserBackground.prototype.ready = function(callback) {}; FileBrowserBackground.prototype.ready = function(callback) {};
/** @type {!analytics.Tracker} */
FileBrowserBackground.prototype.tracker;
/** @type {!Object<!Window>} */ /** @type {!Object<!Window>} */
FileBrowserBackground.prototype.dialogs; FileBrowserBackground.prototype.dialogs;
...@@ -350,7 +350,6 @@ js_library("volume_manager_util") { ...@@ -350,7 +350,6 @@ js_library("volume_manager_util") {
deps = [ deps = [
":volume_info_impl", ":volume_info_impl",
"../../common/js:metrics", "../../common/js:metrics",
"../../common/js:metrics_events",
"../../common/js:util", "../../common/js:util",
"//ui/file_manager/base/js:volume_manager_types", "//ui/file_manager/base/js:volume_manager_types",
] ]
......
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
function FileBrowserBackgroundImpl() { function FileBrowserBackgroundImpl() {
BackgroundBase.call(this); BackgroundBase.call(this);
/** @type {!analytics.Tracker} */
this.tracker = metrics.getTracker();
/** /**
* Progress center of the background page. * Progress center of the background page.
* @type {!ProgressCenter} * @type {!ProgressCenter}
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
// error_counter.js must be loaded before all other scripts of the Files app. // error_counter.js must be loaded before all other scripts of the Files app.
// <include src="../../../base/js/error_counter.js"> // <include src="../../../base/js/error_counter.js">
// <include src="../../common/js/metrics_events.js">
// <include src="../../common/js/metrics.js"> // <include src="../../common/js/metrics.js">
// <include src="metrics_start.js"> // <include src="metrics_start.js">
// <include src="../../common/js/lru_cache.js"> // <include src="../../common/js/lru_cache.js">
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<script src="../../common/js/async_util.js"></script> <script src="../../common/js/async_util.js"></script>
<script src="../../common/js/metrics_base.js"></script> <script src="../../common/js/metrics_base.js"></script>
<script src="../../common/js/metrics_events.js"></script>
<script src="../../common/js/mock_entry.js"></script> <script src="../../common/js/mock_entry.js"></script>
<script src="../../../base/js/test_error_reporting.js"></script> <script src="../../../base/js/test_error_reporting.js"></script>
<script src="../../../base/js/mock_chrome.js"></script> <script src="../../../base/js/mock_chrome.js"></script>
......
...@@ -26,7 +26,6 @@ js_type_check("closure_compile_module") { ...@@ -26,7 +26,6 @@ js_type_check("closure_compile_module") {
":lru_cache", ":lru_cache",
":metrics", ":metrics",
":metrics_base", ":metrics_base",
":metrics_events",
":mock_entry", ":mock_entry",
":progress_center_common", ":progress_center_common",
":util", ":util",
...@@ -126,8 +125,6 @@ js_unittest("lru_cache_unittest") { ...@@ -126,8 +125,6 @@ js_unittest("lru_cache_unittest") {
} }
js_library("metrics") { js_library("metrics") {
# |metrics| and |metrics_events| are for analytics. Don't leak this dependency
# outside of the core files app.
visibility = [] visibility = []
visibility = [ "//ui/file_manager/file_manager/*" ] visibility = [ "//ui/file_manager/file_manager/*" ]
deps = [ deps = [
...@@ -135,21 +132,12 @@ js_library("metrics") { ...@@ -135,21 +132,12 @@ js_library("metrics") {
"../../../externs:file_manager_private", "../../../externs:file_manager_private",
"//ui/webui/resources/js:assert", "//ui/webui/resources/js:assert",
] ]
externs_list = [ "//third_party/analytics/externs.js" ]
} }
js_library("metrics_base") { js_library("metrics_base") {
externs_list = [ "$externs_path/metrics_private.js" ] externs_list = [ "$externs_path/metrics_private.js" ]
} }
js_library("metrics_events") {
visibility = []
visibility = [ "//ui/file_manager/file_manager/*" ]
deps = [
":metrics_base",
]
}
js_library("mock_entry") { js_library("mock_entry") {
deps = [ deps = [
":util", ":util",
...@@ -162,6 +150,7 @@ js_library("progress_center_common") { ...@@ -162,6 +150,7 @@ js_library("progress_center_common") {
js_library("unittest_util") { js_library("unittest_util") {
testonly = true testonly = true
# Only files app tests use this util file. # Only files app tests use this util file.
visibility = [] visibility = []
visibility = [ "//ui/file_manager/file_manager/*" ] visibility = [ "//ui/file_manager/file_manager/*" ]
......
per-file importer_common*=smckay@chromium.org per-file importer_common*=smckay@chromium.org
# Changes to analytics reporting structures can have disruptive effects on the
# analytics history of the Files app (e.g. making it hard or impossible to detect trending). Such changes need to be reviewed by someone familiar with the analytics system.
per-file metrics_events.js=set noparent
per-file metrics_events.js=fukino@chromium.org
per-file metrics_events.js=kenobi@chromium.org
per-file metrics_events.js=smckay@chromium.org
...@@ -772,35 +772,14 @@ importer.Logger.prototype.catcher; ...@@ -772,35 +772,14 @@ importer.Logger.prototype.catcher;
* @final * @final
* *
* @param {!Promise<!FileEntry>} fileEntryPromise * @param {!Promise<!FileEntry>} fileEntryPromise
* @param {!Promise<!analytics.Tracker>} trackerPromise
*/ */
importer.RuntimeLogger = function(fileEntryPromise, trackerPromise) { importer.RuntimeLogger = function(fileEntryPromise) {
/** @private {!Promise<!importer.PromisingFileEntry>} */ /** @private {!Promise<!importer.PromisingFileEntry>} */
this.fileEntryPromise_ = fileEntryPromise.then( this.fileEntryPromise_ = fileEntryPromise.then(
/** @param {!FileEntry} fileEntry */ /** @param {!FileEntry} fileEntry */
function(fileEntry) { function(fileEntry) {
return new importer.PromisingFileEntry(fileEntry); return new importer.PromisingFileEntry(fileEntry);
}); });
/** @private {!Promise<!analytics.Tracker>} */
this.trackerPromise_ = trackerPromise;
};
/**
* Reports an error to analytics.
*
* @param {string} context MUST NOT contain any dynamic error content,
* only statically defined string will dooooo.
*/
importer.RuntimeLogger.prototype.reportErrorContext_ = function(context) {
this.trackerPromise_.then(
/** @param {!analytics.Tracker} tracker */
function(tracker) {
tracker.sendException(
context,
false /* fatal */ );
});
}; };
/** @override */ /** @override */
...@@ -820,7 +799,6 @@ importer.RuntimeLogger.prototype.catcher = function(context) { ...@@ -820,7 +799,6 @@ importer.RuntimeLogger.prototype.catcher = function(context) {
var prefix = '(' + context + ') '; var prefix = '(' + context + ') ';
return function(error) { return function(error) {
this.reportErrorContext_(context);
var message = prefix + 'Caught error in promise chain.'; var message = prefix + 'Caught error in promise chain.';
// Append error info, if provided, then output the error. // Append error info, if provided, then output the error.
...@@ -912,34 +890,12 @@ importer.getLogger = function() { ...@@ -912,34 +890,12 @@ importer.getLogger = function() {
importer.logger_ = new importer.RuntimeLogger( importer.logger_ = new importer.RuntimeLogger(
importer.ChromeSyncFilesystem.getOrCreateFileEntry( importer.ChromeSyncFilesystem.getOrCreateFileEntry(
/** @type {!Promise<string>} */ (rotator().then( /** @type {!Promise<string>} */ (rotator().then(
importer.getDebugLogFilename.bind(null, nextLogId)))), importer.getDebugLogFilename.bind(null, nextLogId)))));
importer.getTracker_());
} }
return importer.logger_; return importer.logger_;
}; };
/**
* Fetch analytics.Tracker from background page.
* @return {!Promise<!analytics.Tracker>}
* @private
*/
importer.getTracker_ = function() {
return new Promise(
function(resolve, reject) {
chrome.runtime.getBackgroundPage(
function(/** BackgroundWindow */ opt_background) {
if (chrome.runtime.lastError) {
reject(chrome.runtime.lastError);
}
opt_background.background.ready(
function() {
resolve(opt_background.background.tracker);
});
});
});
};
/** /**
* Returns the log ID for the next debug log to use. * Returns the log ID for the next debug log to use.
* @private * @private
......
...@@ -21,86 +21,3 @@ var metrics = metrics || metricsBase; ...@@ -21,86 +21,3 @@ var metrics = metrics || metricsBase;
metrics.convertName_ = function(name) { metrics.convertName_ = function(name) {
return 'FileBrowser.' + name; return 'FileBrowser.' + name;
}; };
/** @private {analytics.GoogleAnalytics} */
metrics.analytics_ = null;
/** @private {analytics.Tracker} */
metrics.tracker_ = null;
/** @private {boolean} */
metrics.enabled_ = false;
/** @return {!analytics.Tracker} */
metrics.getTracker = function() {
if (!metrics.tracker_) {
metrics.createTracker_();
}
return /** @type {!analytics.Tracker} */ (metrics.tracker_);
};
/**
* Creates a new analytics tracker.
* @private
*/
metrics.createTracker_ = function() {
var chromeVersion = /Chrome\/([0-9]*)\.[0-9.]*/.exec(navigator.userAgent);
if (chromeVersion && chromeVersion[1]) {
metrics.analytics_ = analytics.getService('Files app', chromeVersion[1]);
} else {
metrics.analytics_ = analytics.getService('Files app', '0.0');
}
// Create a tracker, add a filter that only enables analytics when UMA is
// enabled.
const kFilesAppTrackingId = 'UA-38248358-9';
metrics.tracker_ = metrics.analytics_.getTracker(kFilesAppTrackingId);
metrics.tracker_.addFilter(metrics.umaEnabledFilter_);
};
/**
* Queries the chrome UMA enabled setting, and filters hits based on that.
* @param {!analytics.Tracker.Hit} hit
* @return {!goog.async.Deferred} A deferred indicating when the filter has
* completed running.
* @private
*/
metrics.umaEnabledFilter_ = function(hit) {
// TODO(kenobi): Change this to use Promises when analytics supports it.
var deferred = new goog.async.Deferred();
chrome.fileManagerPrivate.isUMAEnabled(
function(enabled) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
assert(enabled !== undefined);
if (!enabled) {
// If UMA was just toggled, reset the analytics ID.
if (metrics.enabled_) {
metrics.clearUserId_();
}
hit.cancel();
}
metrics.enabled_ = enabled;
// TODO(sashab): We should call deferred.callback(enabled) here, but
// this can cause strange issues when behind certain VPNs. In the
// meantime, don't call anything, so Analytics is never contacted, which
// prevents this issue. See https://crbug.com/842880 for details.
});
return deferred;
};
/**
* Clears the previously set analytics user id.
* @return {!Promise} Resolves when the analytics ID has been reset.
*/
metrics.clearUserId_ = function() {
return metrics.analytics_.getConfig().then(
/** @param {!analytics.Config} config */
function(config) {
config.resetUserId();
});
};
// Copyright 2015 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.
// Changes to analytics reporting structures can have disruptive effects on the
// analytics history of the Files app (e.g. making it hard or impossible to
// detect trending).
//
// In general, treat changes to analytics like histogram changes, i.e. make
// additive changes, don't remove or rename existing Dimensions, Events, Labels,
// etc.
//
// Changes to this file will need to be reviewed by someone familiar with the
// analytics system.
// namespace
var metrics = metrics || metricsBase;
/** @enum {string} */
metrics.Categories = {
ACQUISITION: 'Acquisition',
MANAGEMENT: 'Management',
INTERNALS: 'Internals'
};
/**
* The values of these enums come from the analytics console.
* @private @enum {number}
*/
metrics.Dimension_ = {
CONSUMER_TYPE: 1,
SESSION_TYPE: 2,
MACHINE_USE: 3
};
/**
* Enumeration of known FSPs used to qualify "providers"
* "screens" on analytics. All FSPs NOT present in this list
* will be reported to analytics as 'provided-unknown'.
*
* NOTE: When an unknown provider is encountered, a separate event will be
* sent to analytics with the id. Consulation of that event will provided
* an indication when a provider is popular enough to be added to the
* whitelist.
*
* These look like extension ids, but are actually provider ids which may
* but don't have to be extension ids.
*
* @enum {string}
*/
metrics.FileSystemProviders = {
oedeeodfidgoollimchfdnbmhcpnklnd: 'ZipUnpacker',
hlffpaajmfllggclnjppbblobdhokjhe: 'File System for Dropbox (YT)',
jbfdfcehgafdbfpniaimfbfomafoadgo: 'File System for OneDrive (YT)',
gbheifiifcfekkamhepkeogobihicgmn: 'SFTP File System (YT)',
dikonaebkejmpbpcnnmfaeopkaenicgf: 'Box for Chrome OS',
iibcngmpkgghccnakicfmgajlkhnohep: 'TED Talks (FB)',
hmckflbfniicjijmdoffagjkpnjgbieh: 'WebDAV File System (YT)',
ibfbhbegfkamboeglpnianlggahglbfi: 'Cloud Storage (FB)',
pmnllmkmjilbojkpgplbdmckghmaocjh: 'Scan (FB)',
mfhnnfciefdpolbelmfkpmhhmlkehbdf: 'File System for SMB/CIFS (YT)',
plmanjiaoflhcilcfdnjeffklbgejmje: 'Add MY Documents (KA)',
mljpablpddhocfbnokacjggdbmafjnon: 'Wicked Good Unarchiver (MF)',
ndjpildffkeodjdaeebdhnncfhopkajk: 'Network File Share for Chrome OS',
gmhmnhjihabohahcllfgjooaoecglhpi: 'LanFolder',
dmboannefpncccogfdikhmhpmdnddgoe: 'ZipArchiver',
/**
* Native Providers.
*/
'@smb': 'Native Network File Share (SMB)',
};
/**
* Returns a new "screen" name for a provided file system type. Returns
* 'unknown' for unknown providers.
* @param {string|undefined} providerId The FSP provider ID.
* @return {string} Name or 'unknown' if extension is unrecognized.
*/
metrics.getFileSystemProviderName = function(providerId) {
return metrics.FileSystemProviders[providerId] || 'unknown';
};
/**
* @enum {!analytics.EventBuilder.Dimension}
*/
metrics.Dimensions = {
CONSUMER_TYPE_MANAGER: {
index: metrics.Dimension_.CONSUMER_TYPE,
value: 'Manage'
},
CONSUMER_TYPE_IMPORTER: {
index: metrics.Dimension_.CONSUMER_TYPE,
value: 'Import'
},
SESSION_TYPE_MANAGE: {
index: metrics.Dimension_.SESSION_TYPE,
value: 'Manage'
},
MACHINE_USE_SINGLE: {
index: metrics.Dimension_.MACHINE_USE,
value: 'Single'
},
MACHINE_USE_MULTIPLE: {
index: metrics.Dimension_.MACHINE_USE,
value: 'Multiple'
}
};
// namespace
metrics.event = metrics.event || {};
/**
* Base event builders for files app.
* @private @enum {!analytics.EventBuilder}
*/
metrics.event.Builders_ = {
IMPORT: analytics.EventBuilder.builder()
.category(metrics.Categories.ACQUISITION),
INTERNALS: analytics.EventBuilder.builder()
.category(metrics.Categories.INTERNALS),
MANAGE: analytics.EventBuilder.builder()
.category(metrics.Categories.MANAGEMENT)
};
/** @enum {!analytics.EventBuilder} */
metrics.Management = {
WINDOW_CREATED: metrics.event.Builders_.MANAGE
.action('Window Created')
.dimension(metrics.Dimensions.SESSION_TYPE_MANAGE)
.dimension(metrics.Dimensions.CONSUMER_TYPE_MANAGER)
};
/** @enum {!analytics.EventBuilder} */
metrics.Internals = {
UNRECOGNIZED_FILE_SYSTEM_PROVIDER: metrics.event.Builders_.INTERNALS
.action('Unrecognized File System Provider')
};
// namespace
metrics.timing = metrics.timing || {};
/** @enum {string} */
metrics.timing.Variables = {
EXTRACT_THUMBNAIL_FROM_RAW: 'Extract Thumbnail From RAW'
};
// Copyright 2015 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.
/**
* A tracker to substitute for analytics.Tracker in tests.
* @construtor
* @implements {analytics.Tracker}
*/
TestTracker = function() {};
/**
* @param {!analytics.HitType|!analytics.EventBuilder} hitType
* @param {(!analytics.ParameterMap|
* !Object<!analytics.Value>)=} opt_extraParams
* @return {!goog.async.Deferred}
*/
TestTracker.prototype.send = function(hitType, opt_extraParams) {
};
/**
* @param {string} description
* @return {!goog.async.Deferred}
*/
TestTracker.prototype.sendAppView = function() {};
/**
* @param {string} category
* @param {string} action
* @param {string=} opt_label
* @param {number=} opt_value
* @return {!goog.async.Deferred}
*/
TestTracker.prototype.sendEvent = function() {};
/**
* @param {string} network Specifies the social network, for example Facebook
* or Google Plus.
* @param {string} action Specifies the social interaction action.
* For example on Google Plus when a user clicks the +1 button,
* the social action is 'plus'.
* @param {string} target Specifies the target of a social interaction.
* This value is typically a URL but can be any text.
* @return {!goog.async.Deferred}
*/
TestTracker.prototype.sendSocial = function() {};
/**
* @param {string=} opt_description Specifies the description of an exception.
* @param {boolean=} opt_fatal Was the exception fatal.
* @return {!goog.async.Deferred}
*/
TestTracker.prototype.sendException = function() {};
/**
* @param {string} category Specifies the category of the timing.
* @param {string} variable Specifies the variable name of the timing.
* @param {number} value Specifies the value of the timing.
* @param {string=} opt_label Specifies the optional label of the timing.
* @param {number=} opt_sampleRate
* @return {!goog.async.Deferred}
*/
TestTracker.prototype.sendTiming = function() {};
TestTracker.prototype.forceSessionStart = function() {};
/**
* @param {string} category
* @param {string} variable
* @param {string=} opt_label
* @param {number=} opt_sampleRate
* @return {!TestTracker.Timing}
*/
TestTracker.prototype.startTiming = function() {
return /** @type {!TestTracker.Timing} */ ({
send: function() {}
});
};
...@@ -238,7 +238,6 @@ js_library("directory_model") { ...@@ -238,7 +238,6 @@ js_library("directory_model") {
":directory_contents", ":directory_contents",
":file_watcher", ":file_watcher",
"../../common/js:importer_common", "../../common/js:importer_common",
"../../common/js:metrics_events",
"ui:file_list_selection_model", "ui:file_list_selection_model",
] ]
externs_list = [ externs_list = [
......
...@@ -21,15 +21,10 @@ var SHORT_RESCAN_INTERVAL = 100; ...@@ -21,15 +21,10 @@ var SHORT_RESCAN_INTERVAL = 100;
* service. * service.
* @param {!VolumeManager} volumeManager The volume manager. * @param {!VolumeManager} volumeManager The volume manager.
* @param {!FileOperationManager} fileOperationManager File operation manager. * @param {!FileOperationManager} fileOperationManager File operation manager.
* @param {!analytics.Tracker} tracker
*/ */
function DirectoryModel( function DirectoryModel(
singleSelection, singleSelection, fileFilter, metadataModel, volumeManager,
fileFilter, fileOperationManager) {
metadataModel,
volumeManager,
fileOperationManager,
tracker) {
this.fileListSelection_ = singleSelection ? this.fileListSelection_ = singleSelection ?
new FileListSingleSelectionModel() : new FileListSelectionModel(); new FileListSingleSelectionModel() : new FileListSelectionModel();
...@@ -82,9 +77,6 @@ function DirectoryModel( ...@@ -82,9 +77,6 @@ function DirectoryModel(
'entries-changed', 'entries-changed',
this.onEntriesChanged_.bind(this)); this.onEntriesChanged_.bind(this));
/** @private {!analytics.Tracker} */
this.tracker_ = tracker;
/** @private {string} */ /** @private {string} */
this.lastSearchQuery_ = ''; this.lastSearchQuery_ = '';
} }
...@@ -1017,64 +1009,10 @@ DirectoryModel.prototype.changeDirectoryEntry = function( ...@@ -1017,64 +1009,10 @@ DirectoryModel.prototype.changeDirectoryEntry = function(
event.newDirEntry = dirEntry; event.newDirEntry = dirEntry;
event.volumeChanged = previousVolumeInfo !== currentVolumeInfo; event.volumeChanged = previousVolumeInfo !== currentVolumeInfo;
this.dispatchEvent(event); this.dispatchEvent(event);
if (currentVolumeInfo && event.volumeChanged) {
this.onVolumeChanged_(assert(currentVolumeInfo));
}
}.bind(this)); }.bind(this));
}.bind(this, this.changeDirectorySequence_)); }.bind(this, this.changeDirectorySequence_));
}; };
/**
* Handles volume changed by sending an analytics appView event.
*
* @param {!VolumeInfo} volumeInfo The new volume info.
* @return {!Promise} resolves once handling is done.
* @private
*/
DirectoryModel.prototype.onVolumeChanged_ = function(volumeInfo) {
// NOTE: That dynamic values, like volume name MUST NOT
// be sent to GA as that value can contain PII.
// VolumeType is an enum.
// ...
// But we can do stuff like figure out if this is a media device or vanilla
// removable device.
return Promise.resolve(undefined)
.then(
(/** @this {DirectoryModel} */
function() {
switch (volumeInfo.volumeType) {
case VolumeManagerCommon.VolumeType.REMOVABLE:
return importer.hasMediaDirectory(volumeInfo.fileSystem.root)
.then(
/**
* @param {boolean} hasMedia
* @return {string}
*/
function(hasMedia) {
return hasMedia ?
volumeInfo.volumeType + ':with-media-dir' :
volumeInfo.volumeType;
});
case VolumeManagerCommon.VolumeType.PROVIDED:
var providerId = volumeInfo.providerId;
var name = metrics.getFileSystemProviderName(providerId);
// Make note of an unrecognized provider id. When we see
// high counts for a particular id, we should add it to the
// whitelist in metrics_events.js.
if (providerId && name == 'unknown') {
this.tracker_.send(
metrics.Internals.UNRECOGNIZED_FILE_SYSTEM_PROVIDER.label(
providerId));
}
return volumeInfo.volumeType + ':' + name;
default:
return volumeInfo.volumeType;
}
}).bind(this))
.then(this.tracker_.sendAppView.bind(this.tracker_));
};
/** /**
* Activates the given directory. * Activates the given directory.
* This method: * This method:
......
...@@ -138,11 +138,6 @@ function FileManager() { ...@@ -138,11 +138,6 @@ function FileManager() {
*/ */
this.ui_ = null; this.ui_ = null;
/**
* @private {analytics.Tracker}
*/
this.tracker_ = null;
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Parameters determining the type of file manager. // Parameters determining the type of file manager.
...@@ -517,12 +512,6 @@ FileManager.prototype = /** @struct */ { ...@@ -517,12 +512,6 @@ FileManager.prototype = /** @struct */ {
*/ */
get ui() { get ui() {
return this.ui_; return this.ui_;
},
/**
* @return {analytics.Tracker}
*/
get tracker() {
return this.tracker_;
} }
}; };
...@@ -870,12 +859,6 @@ FileManager.prototype = /** @struct */ { ...@@ -870,12 +859,6 @@ FileManager.prototype = /** @struct */ {
// Initialize the member variables that depend this.launchParams_. // Initialize the member variables that depend this.launchParams_.
this.dialogType = this.launchParams_.type; this.dialogType = this.launchParams_.type;
// We used to share the tracker with background, but due to
// its use of instanceof checks for some functionality
// we really can't do this (as instanceof checks fail across
// different script contexts).
this.tracker_ = metrics.getTracker();
}; };
/** /**
...@@ -1100,12 +1083,8 @@ FileManager.prototype = /** @struct */ { ...@@ -1100,12 +1083,8 @@ FileManager.prototype = /** @struct */ {
assert(this.fileOperationManager_); assert(this.fileOperationManager_);
assert(this.metadataModel_); assert(this.metadataModel_);
this.directoryModel_ = new DirectoryModel( this.directoryModel_ = new DirectoryModel(
singleSelection, singleSelection, this.fileFilter_, this.metadataModel_,
this.fileFilter_, this.volumeManager_, this.fileOperationManager_);
this.metadataModel_,
this.volumeManager_,
this.fileOperationManager_,
assert(this.tracker_));
this.folderShortcutsModel_ = new FolderShortcutsDataModel( this.folderShortcutsModel_ = new FolderShortcutsDataModel(
this.volumeManager_); this.volumeManager_);
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<script src="../../common/js/files_app_entry_types.js"></script> <script src="../../common/js/files_app_entry_types.js"></script>
<script src="../../common/js/util.js"></script> <script src="../../common/js/util.js"></script>
<script src="../../common/js/metrics_base.js"></script> <script src="../../common/js/metrics_base.js"></script>
<script src="../../common/js/metrics_events.js"></script>
<script src="../../../base/js/volume_manager_types.js"></script> <script src="../../../base/js/volume_manager_types.js"></script>
<script src="../../common/js/file_type.js"></script> <script src="../../common/js/file_type.js"></script>
<script src="../../common/js/importer_common.js"></script> <script src="../../common/js/importer_common.js"></script>
......
...@@ -22,8 +22,6 @@ fileManager.initializeCore(); ...@@ -22,8 +22,6 @@ fileManager.initializeCore();
function initializeUI() { function initializeUI() {
fileManager.initializeUI(document.body).then(() => { fileManager.initializeUI(document.body).then(() => {
util.testSendMessage('ready'); util.testSendMessage('ready');
metrics.recordInterval('Load.Total');
fileManager.tracker.send(metrics.Management.WINDOW_CREATED);
}); });
} }
...@@ -36,6 +34,3 @@ if (document.readyState === 'loading') { ...@@ -36,6 +34,3 @@ if (document.readyState === 'loading') {
} else { } else {
initializeUI(); initializeUI();
} }
/** Record script load metric: must be the last line. */
metrics.recordInterval('Load.Script');
...@@ -72,10 +72,6 @@ ...@@ -72,10 +72,6 @@
// <include src="../../../../webui/resources/js/cr/ui/menu.js"> // <include src="../../../../webui/resources/js/cr/ui/menu.js">
// <include src="../../../../webui/resources/js/cr/ui/menu_button.js"> // <include src="../../../../webui/resources/js/cr/ui/menu_button.js">
// <include src="../../../../webui/resources/js/cr/ui/context_menu_handler.js"> // <include src="../../../../webui/resources/js/cr/ui/context_menu_handler.js">
//
// <include src="../../../../webui/resources/js/analytics.js">
// metrics_events.js must be loaded after the analytics package.
// <include src="../../common/js/metrics_events.js">
(function() { (function() {
// 'strict mode' is invoked for this scope. // 'strict mode' is invoked for this scope.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment