Commit 502b02f1 authored by Sheng-hao Tsao's avatar Sheng-hao Tsao Committed by Commit Bot

Revert "Show consolidated camera icon on shelf"

This reverts commit 1de878d8.

Reason for revert: Causes many crashes like
https://bugs.chromium.org/p/chromium/issues/detail?id=903443
https://buganizer.corp.google.com/issues/119116273


Original change's description:
> Show consolidated camera icon on shelf
> 
> This CL fixes 2 bugs:
> 
> 1. Users might pin the internal app to the shelf. Clicking on it would
> launch a real camera app, causing 2 camera icons shown on the shelf.
> 2. Users might pin the currently running camera app on the shelf. If the
> users click on it afterward, it will bypass the internal app deciding
> logic and always launch that specific app.
> 
> pinned the internal camera app icon, and launching camera app from it
> does not show 2 camera icons on shelf.
> 
> Bug: b:117909556
> Test: Tested on eve that pinning camera app on launcher or on shelf both
> Change-Id: I0300456595e6c4c00c1a47f7a3bc7309d1230553
> Reviewed-on: https://chromium-review.googlesource.com/c/1303327
> Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
> Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
> Reviewed-by: Tao Wu <wutao@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#603793}

TBR=stevenjb@chromium.org,shenghao@google.com,wutao@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: b:117909556
Change-Id: I20f4ea5762b29dbdbba0ad08592ff3755f06c023
Reviewed-on: https://chromium-review.googlesource.com/c/1328632Reviewed-by: default avatarRicky Liang <jcliang@chromium.org>
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607914}
parent c6954fbf
...@@ -99,11 +99,8 @@ void ArcAppWindow::SetDefaultAppIcon() { ...@@ -99,11 +99,8 @@ void ArcAppWindow::SetDefaultAppIcon() {
profile_, extension_misc::EXTENSION_ICON_SMALL, this); profile_, extension_misc::EXTENSION_ICON_SMALL, this);
} }
DCHECK(!image_fetching_); DCHECK(!image_fetching_);
std::string app_id = app_shelf_id_.ToString(); base::AutoReset<bool> auto_image_fetching(&image_fetching_, true);
if (app_icon_loader_->CanLoadImageForApp(app_id)) { app_icon_loader_->FetchImage(app_shelf_id_.ToString());
base::AutoReset<bool> auto_image_fetching(&image_fetching_, true);
app_icon_loader_->FetchImage(app_id);
}
} }
void ArcAppWindow::SetIcon(const gfx::ImageSkia& icon) { void ArcAppWindow::SetIcon(const gfx::ImageSkia& icon) {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <string> #include <string>
#include "ash/public/cpp/app_list/internal_app_id_constants.h"
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_model.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
...@@ -36,17 +35,6 @@ namespace { ...@@ -36,17 +35,6 @@ namespace {
constexpr size_t kMaxIconPngSize = 64 * 1024; // 64 kb constexpr size_t kMaxIconPngSize = 64 * 1024; // 64 kb
// Generated as ArcAppListPrefs::GetAppIdByPackageName(
// "com.google.android.GoogleCameraArc").
constexpr char kAndroidCameraAppId[] = "goamfaniemdfcajgcmmflhchgkmbngka";
// Generated as ArcAppListPrefs::GetAppIdByPackageName(
// "com.android.camera2").
constexpr char kAndroidLegacyCameraAppId[] = "obfofkigjfamlldmipdegnjlcpincibc";
// Generated as ArcAppListPrefs::GetAppIdByPackageName(
// "com.android.googlecameramigration").
constexpr char kAndroidCameraMigrationAppId[] =
"ngmkobaiicipbagcngcmilfkhejlnfci";
} // namespace } // namespace
// The information about the arc application window which has to be kept // The information about the arc application window which has to be kept
...@@ -307,17 +295,8 @@ void ArcAppWindowLauncherController::OnTaskCreated( ...@@ -307,17 +295,8 @@ void ArcAppWindowLauncherController::OnTaskCreated(
DCHECK(!GetAppWindowForTask(task_id)); DCHECK(!GetAppWindowForTask(task_id));
const std::string arc_app_id = const std::string arc_app_id =
ArcAppListPrefs::GetAppId(package_name, activity_name); ArcAppListPrefs::GetAppId(package_name, activity_name);
std::string app_id_consolidated = arc_app_id;
// For camera app, always put the internal app icon onto shelf.
if (arc_app_id.compare(kAndroidCameraAppId) == 0 ||
arc_app_id.compare(kAndroidCameraMigrationAppId) == 0 ||
arc_app_id.compare(kAndroidLegacyCameraAppId) == 0) {
app_id_consolidated = app_list::kInternalAppIdCamera;
}
const arc::ArcAppShelfId arc_app_shelf_id = const arc::ArcAppShelfId arc_app_shelf_id =
arc::ArcAppShelfId::FromIntentAndAppId(intent, app_id_consolidated); arc::ArcAppShelfId::FromIntentAndAppId(intent, arc_app_id);
task_id_to_app_window_info_[task_id] = task_id_to_app_window_info_[task_id] =
std::make_unique<AppWindowInfo>(arc_app_shelf_id, intent, package_name); std::make_unique<AppWindowInfo>(arc_app_shelf_id, intent, package_name);
// Don't create shelf icon for non-primary user. // Don't create shelf icon for non-primary user.
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <memory> #include <memory>
#include "ash/public/cpp/app_list/internal_app_id_constants.h"
#include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_model.h"
#include "ash/public/cpp/shelf_types.h" #include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
...@@ -29,8 +28,6 @@ using extensions::AppWindowRegistry; ...@@ -29,8 +28,6 @@ using extensions::AppWindowRegistry;
namespace { namespace {
constexpr char kChromeCameraAppId[] = "hfhhnacclhffhdffklopdkcgdhifgngh";
// Get the ShelfID for a given |app_window|. // Get the ShelfID for a given |app_window|.
ash::ShelfID GetShelfId(AppWindow* app_window) { ash::ShelfID GetShelfId(AppWindow* app_window) {
// Set launch_id default value to an empty string. If showInShelf parameter // Set launch_id default value to an empty string. If showInShelf parameter
...@@ -43,12 +40,7 @@ ash::ShelfID GetShelfId(AppWindow* app_window) { ...@@ -43,12 +40,7 @@ ash::ShelfID GetShelfId(AppWindow* app_window) {
else else
launch_id = base::StringPrintf("%d", app_window->session_id().id()); launch_id = base::StringPrintf("%d", app_window->session_id().id());
} }
return ash::ShelfID(app_window->extension_id(), launch_id);
// For camera app, always put the internal app icon onto shelf.
std::string app_id = app_window->extension_id();
if (app_id.compare(kChromeCameraAppId) == 0)
app_id = app_list::kInternalAppIdCamera;
return ash::ShelfID(app_id, launch_id);
} }
} // namespace } // namespace
......
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