Commit 54762d76 authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Remove util.boardIs and its one user.

Querying the board from the files app is only used for deciding which
Drive promo to display: specifically, whether the board is link, which
is now AUE. This is now unnecessary so remove it.

Bug: 906983
Change-Id: Ia98c9e96b81609fdacd46a4d464da18a6cbd1fdc
Reviewed-on: https://chromium-review.googlesource.com/c/1343591Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609634}
parent 064aea7c
...@@ -1024,9 +1024,6 @@ ...@@ -1024,9 +1024,6 @@
<message name="IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE_ALTERNATIVE" desc="In the Welcome to Google Drive banner, title of the alternative banner offering 100GB free storage."> <message name="IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE_ALTERNATIVE" desc="In the Welcome to Google Drive banner, title of the alternative banner offering 100GB free storage.">
Get 100 GB free with Google Drive Get 100 GB free with Google Drive
</message> </message>
<message name="IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE_ALTERNATIVE_1TB" desc="In the Welcome to Google Drive banner, title of the alternative banner offering 1TB free storage.">
Get 1 TB free with Google Drive
</message>
<message name="IDS_FILE_BROWSER_DRIVE_WELCOME_TEXT_SHORT" desc="In the Welcome to Google Drive banner, text of the welcome message, short version."> <message name="IDS_FILE_BROWSER_DRIVE_WELCOME_TEXT_SHORT" desc="In the Welcome to Google Drive banner, text of the welcome message, short version.">
All files saved in this folder are backed up online automatically All files saved in this folder are backed up online automatically
</message> </message>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <utility> #include <utility>
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/file_manager/open_with_browser.h" #include "chrome/browser/chromeos/file_manager/open_with_browser.h"
#include "chrome/browser/chromeos/login/demo_mode/demo_session.h" #include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
...@@ -166,8 +165,6 @@ void AddStringsForDrive(base::DictionaryValue* dict) { ...@@ -166,8 +165,6 @@ void AddStringsForDrive(base::DictionaryValue* dict) {
SET_STRING("DRIVE_WELCOME_TITLE", IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE); SET_STRING("DRIVE_WELCOME_TITLE", IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE);
SET_STRING("DRIVE_WELCOME_TITLE_ALTERNATIVE", SET_STRING("DRIVE_WELCOME_TITLE_ALTERNATIVE",
IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE_ALTERNATIVE); IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE_ALTERNATIVE);
SET_STRING("DRIVE_WELCOME_TITLE_ALTERNATIVE_1TB",
IDS_FILE_BROWSER_DRIVE_WELCOME_TITLE_ALTERNATIVE_1TB);
SET_STRING("SYNC_DELETE_WITHOUT_PERMISSION_ERROR", SET_STRING("SYNC_DELETE_WITHOUT_PERMISSION_ERROR",
IDS_FILE_BROWSER_SYNC_DELETE_WITHOUT_PERMISSION_ERROR); IDS_FILE_BROWSER_SYNC_DELETE_WITHOUT_PERMISSION_ERROR);
SET_STRING("SYNC_FILE_NAME", IDS_FILE_BROWSER_SYNC_FILE_NAME); SET_STRING("SYNC_FILE_NAME", IDS_FILE_BROWSER_SYNC_FILE_NAME);
...@@ -852,8 +849,6 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() { ...@@ -852,8 +849,6 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() {
dict->SetBoolean( dict->SetBoolean(
"MY_FILES_VOLUME_ENABLED", "MY_FILES_VOLUME_ENABLED",
base::FeatureList::IsEnabled(chromeos::features::kMyFilesVolume)); base::FeatureList::IsEnabled(chromeos::features::kMyFilesVolume));
dict->SetString("CHROMEOS_RELEASE_BOARD",
base::SysInfo::GetLsbReleaseBoard());
dict->SetString( dict->SetString(
"DOWNLOADS_LOW_SPACE_WARNING_HELP_URL", "DOWNLOADS_LOW_SPACE_WARNING_HELP_URL",
base::StringPrintf(kHelpURLFormat, kDownloadsLowSpaceWarningHelpNumber)); base::StringPrintf(kHelpURLFormat, kDownloadsLowSpaceWarningHelpNumber));
......
...@@ -527,24 +527,6 @@ util.AppCache.cleanup_ = function(map) { ...@@ -527,24 +527,6 @@ util.AppCache.cleanup_ = function(map) {
} }
}; };
/**
* Returns true if the board of the device matches the given prefix. Caution:
* There are cases in which the name of one board is a prefix for a different
* (only slightly related) board: E.g. daisy and daisy-spring, peach-pi and
* peach-pit, and maybe others. See also base::GetLsbReleaseBoard().
* @param {string} boardPrefix The board prefix to match against. (ex.
* "x86-mario". Prefix is used as the actual board name comes with suffix
* like "x86-mario-something".
* @return {boolean} True if the board of the device matches the given prefix.
*/
util.boardIs = function(boardPrefix) {
// The board name should be lower-cased, but making it case-insensitive for
// backward compatibility just in case.
var board = str('CHROMEOS_RELEASE_BOARD');
var pattern = new RegExp('^' + boardPrefix, 'i');
return board.match(pattern) != null;
};
/** /**
* Adds an isFocused method to the current window object. * Adds an isFocused method to the current window object.
*/ */
......
...@@ -240,8 +240,6 @@ Banners.prototype.prepareAndShowWelcomeBanner_ = function(type, messageId) { ...@@ -240,8 +240,6 @@ Banners.prototype.prepareAndShowWelcomeBanner_ = function(type, messageId) {
var more; var more;
if (this.usePromoWelcomeBanner_) { if (this.usePromoWelcomeBanner_) {
var welcomeTitle = str('DRIVE_WELCOME_TITLE_ALTERNATIVE'); var welcomeTitle = str('DRIVE_WELCOME_TITLE_ALTERNATIVE');
if (util.boardIs('link'))
welcomeTitle = str('DRIVE_WELCOME_TITLE_ALTERNATIVE_1TB');
title.textContent = welcomeTitle; title.textContent = welcomeTitle;
more = util.createChild(links, '', 'a'); more = util.createChild(links, '', 'a');
more.href = str('GOOGLE_DRIVE_REDEEM_URL'); more.href = str('GOOGLE_DRIVE_REDEEM_URL');
...@@ -388,15 +386,9 @@ Banners.prototype.checkSpaceAndMaybeShowWelcomeBanner_ = function() { ...@@ -388,15 +386,9 @@ Banners.prototype.checkSpaceAndMaybeShowWelcomeBanner_ = function() {
this.usePromoWelcomeBanner_ = false; this.usePromoWelcomeBanner_ = false;
} }
// Choose the offer basing on the board name. The default one is 100 GB.
var offerSize = 100; // In GB. var offerSize = 100; // In GB.
var offerServiceId = 'drive.cros.echo.1'; var offerServiceId = 'drive.cros.echo.1';
if (util.boardIs('link')) {
offerSize = 1024; // 1 TB.
offerServiceId = 'drive.cros.echo.2';
}
// Perform asynchronous tasks in parallel. // Perform asynchronous tasks in parallel.
var group = new AsyncUtil.Group(); var group = new AsyncUtil.Group();
......
...@@ -9,7 +9,6 @@ loadTimeData.data = $GRDP; ...@@ -9,7 +9,6 @@ loadTimeData.data = $GRDP;
// Extend with additional fields not found in grdp files. // Extend with additional fields not found in grdp files.
Object.setPrototypeOf(loadTimeData.data_, { Object.setPrototypeOf(loadTimeData.data_, {
'CHROMEOS_RELEASE_BOARD': 'unknown',
'CROSTINI_FILES_ENABLED': true, 'CROSTINI_FILES_ENABLED': true,
'DRIVE_FS_ENABLED': false, 'DRIVE_FS_ENABLED': false,
'GOOGLE_DRIVE_REDEEM_URL': 'http://www.google.com/intl/en/chrome/devices' + 'GOOGLE_DRIVE_REDEEM_URL': 'http://www.google.com/intl/en/chrome/devices' +
......
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