Commit 8342805f authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

CROS: Removed duplicate release notes app ID.

Bug: 999376
Change-Id: Ib47b1e86a147a0292ba0a0f11dfa2983de8da562
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776856Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692970}
parent fc02e779
...@@ -28,11 +28,6 @@ constexpr char kInternalAppIdCamera[] = "iniodglblcgmngkgdipeiclkdjjpnlbn"; ...@@ -28,11 +28,6 @@ constexpr char kInternalAppIdCamera[] = "iniodglblcgmngkgdipeiclkdjjpnlbn";
// Generated as crx_file::id_util::GenerateId("org.chromium.discover"). // Generated as crx_file::id_util::GenerateId("org.chromium.discover").
constexpr char kInternalAppIdDiscover[] = "pjdncmlmjhcebmcacdddfacepcjmfaoo"; constexpr char kInternalAppIdDiscover[] = "pjdncmlmjhcebmcacdddfacepcjmfaoo";
// Generated as
// web_app::GenerateAppIdFromURL(GURL(
// "https://google.com/chromebook/whatsnew/embedded/")).
constexpr char kReleaseNotesAppId[] = "kddjchdmnnpakappplfnloipgcbioilo";
} // namespace app_list } // namespace app_list
#endif // ASH_PUBLIC_CPP_APP_LIST_INTERNAL_APP_ID_CONSTANTS_H_ #endif // ASH_PUBLIC_CPP_APP_LIST_INTERNAL_APP_ID_CONSTANTS_H_
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/apps/launch_service/launch_service.h" #include "chrome/browser/apps/launch_service/launch_service.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_manager.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_manager.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
...@@ -78,8 +79,8 @@ const std::vector<InternalApp>& GetInternalAppListImpl(bool get_all, ...@@ -78,8 +79,8 @@ const std::vector<InternalApp>& GetInternalAppListImpl(bool get_all,
/*show_in_launcher=*/false, InternalAppName::kContinueReading, /*show_in_launcher=*/false, InternalAppName::kContinueReading,
/*searchable_string_resource_id=*/0}, /*searchable_string_resource_id=*/0},
{kReleaseNotesAppId, IDS_RELEASE_NOTES_NOTIFICATION_TITLE, {chromeos::default_web_apps::kReleaseNotesAppId,
IDR_RELEASE_NOTES_APP_192, IDS_RELEASE_NOTES_NOTIFICATION_TITLE, IDR_RELEASE_NOTES_APP_192,
/*recommendable=*/true, /*recommendable=*/true,
/*searchable=*/false, /*searchable=*/false,
/*show_in_launcher=*/false, InternalAppName::kReleaseNotes, /*show_in_launcher=*/false, InternalAppName::kReleaseNotes,
...@@ -147,8 +148,9 @@ const std::vector<InternalApp>& GetInternalAppList(const Profile* profile) { ...@@ -147,8 +148,9 @@ const std::vector<InternalApp>& GetInternalAppList(const Profile* profile) {
bool IsSuggestionChip(const std::string& app_id) { bool IsSuggestionChip(const std::string& app_id) {
// App IDs for internal apps which should only be shown as suggestion chips. // App IDs for internal apps which should only be shown as suggestion chips.
static const char* kSuggestionChipIds[] = {kInternalAppIdContinueReading, static const char* kSuggestionChipIds[] = {
kReleaseNotesAppId}; kInternalAppIdContinueReading,
chromeos::default_web_apps::kReleaseNotesAppId};
for (size_t i = 0; i < base::size(kSuggestionChipIds); ++i) { for (size_t i = 0; i < base::size(kSuggestionChipIds); ++i) {
if (base::LowerCaseEqualsASCII(app_id, kSuggestionChipIds[i])) if (base::LowerCaseEqualsASCII(app_id, kSuggestionChipIds[i]))
...@@ -231,7 +233,7 @@ void OpenInternalApp(const std::string& app_id, ...@@ -231,7 +233,7 @@ void OpenInternalApp(const std::string& app_id,
} else { } else {
plugin_vm::ShowPluginVmLauncherView(profile); plugin_vm::ShowPluginVmLauncherView(profile);
} }
} else if (app_id == kReleaseNotesAppId) { } else if (app_id == chromeos::default_web_apps::kReleaseNotesAppId) {
base::RecordAction( base::RecordAction(
base::UserMetricsAction("ReleaseNotes.SuggestionChipLaunched")); base::UserMetricsAction("ReleaseNotes.SuggestionChipLaunched"));
chrome::LaunchReleaseNotes(profile); chrome::LaunchReleaseNotes(profile);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "chrome/browser/chromeos/crostini/crostini_registry_service.h" #include "chrome/browser/chromeos/crostini/crostini_registry_service.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h" #include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
#include "chrome/browser/chromeos/extensions/gfx_utils.h" #include "chrome/browser/chromeos/extensions/gfx_utils.h"
#include "chrome/browser/chromeos/release_notes/release_notes_storage.h" #include "chrome/browser/chromeos/release_notes/release_notes_storage.h"
#include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_service.h"
...@@ -917,7 +918,7 @@ void AppSearchProvider::UpdateRecommendedResults( ...@@ -917,7 +918,7 @@ void AppSearchProvider::UpdateRecommendedResults(
title = navigation_title; title = navigation_title;
app->AddSearchableText(title); app->AddSearchableText(title);
} }
} else if (app->id() == kReleaseNotesAppId) { } else if (app->id() == chromeos::default_web_apps::kReleaseNotesAppId) {
auto release_notes_storage = auto release_notes_storage =
std::make_unique<chromeos::ReleaseNotesStorage>(profile_); std::make_unique<chromeos::ReleaseNotesStorage>(profile_);
if (!release_notes_storage->ShouldShowSuggestionChip()) if (!release_notes_storage->ShouldShowSuggestionChip())
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "chrome/browser/chromeos/extensions/default_web_app_ids.h"
#include "chrome/browser/chromeos/release_notes/release_notes_storage.h" #include "chrome/browser/chromeos/release_notes/release_notes_storage.h"
#include "chrome/browser/favicon/large_icon_service_factory.h" #include "chrome/browser/favicon/large_icon_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -69,7 +70,7 @@ InternalAppResult::InternalAppResult(Profile* profile, ...@@ -69,7 +70,7 @@ InternalAppResult::InternalAppResult(Profile* profile,
ash::SearchResultDisplayLocation::kSuggestionChipContainer); ash::SearchResultDisplayLocation::kSuggestionChipContainer);
} }
if (id() == kReleaseNotesAppId) { if (id() == chromeos::default_web_apps::kReleaseNotesAppId) {
SetNotifyVisibilityChange(true); SetNotifyVisibilityChange(true);
// Make sure that if both Continue Reading and Release Notes are available, // Make sure that if both Continue Reading and Release Notes are available,
// Release Notes shows up first in the suggestion chip container. // Release Notes shows up first in the suggestion chip container.
...@@ -195,7 +196,7 @@ void InternalAppResult::GetContextMenuModel(GetMenuModelCallback callback) { ...@@ -195,7 +196,7 @@ void InternalAppResult::GetContextMenuModel(GetMenuModelCallback callback) {
} }
void InternalAppResult::OnVisibilityChanged(bool visibility) { void InternalAppResult::OnVisibilityChanged(bool visibility) {
DCHECK_EQ(id(), kReleaseNotesAppId); DCHECK_EQ(id(), chromeos::default_web_apps::kReleaseNotesAppId);
DCHECK(chromeos::ReleaseNotesStorage(profile()).ShouldShowSuggestionChip()); DCHECK(chromeos::ReleaseNotesStorage(profile()).ShouldShowSuggestionChip());
chromeos::ReleaseNotesStorage(profile()) chromeos::ReleaseNotesStorage(profile())
.DecreaseTimesLeftToShowSuggestionChip(); .DecreaseTimesLeftToShowSuggestionChip();
......
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