Commit 2f46b693 authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

cros: Update offline Highlights app resources path

After the ebuild update, Chrome can assume there's only one version
of the Highlights app existing at a time, and it's the correct version
so board checking is not necessary.


Bug: 819404
Change-Id: I29b837131376a1c47ac3458bb98643c0bfa14e7d
Reviewed-on: https://chromium-review.googlesource.com/1197364
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587823}
parent 5c5abd24
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/optional.h" #include "base/optional.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/sys_info.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "chrome/browser/apps/platform_apps/app_load_service.h" #include "chrome/browser/apps/platform_apps/app_load_service.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -57,11 +56,7 @@ constexpr base::FilePath::CharType kExternalExtensionsPrefsPath[] = ...@@ -57,11 +56,7 @@ constexpr base::FilePath::CharType kExternalExtensionsPrefsPath[] =
// Path relative to the path at which offline demo resources are loaded that // Path relative to the path at which offline demo resources are loaded that
// contains the highlights app. // contains the highlights app.
constexpr char kHighlightsAppPath[] = "chrome_apps/highlights/dist"; constexpr char kHighlightsAppPath[] = "chrome_apps/highlights";
// The name of the subdirectory that contains the resources for the default
// highlights app, used when a board-specific version is not available.
constexpr char kDefaultHighlightsAppResourcesPath[] = "default";
// Path relative to the path at which offline demo resources are loaded that // Path relative to the path at which offline demo resources are loaded that
// contains sample photos. // contains sample photos.
...@@ -360,18 +355,8 @@ void DemoSession::LoadAndLaunchHighlightsApp() { ...@@ -360,18 +355,8 @@ void DemoSession::LoadAndLaunchHighlightsApp() {
} }
Profile* profile = ProfileManager::GetPrimaryUserProfile(); Profile* profile = ProfileManager::GetPrimaryUserProfile();
DCHECK(profile); DCHECK(profile);
const std::vector<std::string> board = const base::FilePath resources_path =
base::SplitString(base::SysInfo::GetLsbReleaseBoard(), "-", offline_resources_path_.Append(kHighlightsAppPath);
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
const std::string board_name = board[0];
base::FilePath resources_path =
offline_resources_path_.Append(kHighlightsAppPath)
.Append(kDefaultHighlightsAppResourcesPath);
base::FilePath board_specific_resources_path =
offline_resources_path_.Append(kHighlightsAppPath).Append(board_name);
if (base::PathExists(board_specific_resources_path))
resources_path = board_specific_resources_path;
if (!apps::AppLoadService::Get(profile)->LoadAndLaunch( if (!apps::AppLoadService::Get(profile)->LoadAndLaunch(
resources_path, base::CommandLine(base::CommandLine::NO_PROGRAM), resources_path, base::CommandLine(base::CommandLine::NO_PROGRAM),
base::FilePath() /* cur_dir */)) { base::FilePath() /* cur_dir */)) {
......
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