Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3418)

Unified Diff: chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc

Issue 2282023002: arc: Support window recreation. (Closed)
Patch Set: rebase + nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
index e74ed8855e6890b282c0131e7ecdf814d37f0f69..5d26ea1fdf0a915b2caff10f889e5b832859d1dd 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
@@ -7,6 +7,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
@@ -24,6 +25,28 @@ ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController(
ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {}
+void ArcAppWindowLauncherItemController::AddTaskId(int task_id) {
+ task_ids_.insert(task_id);
+}
+
+void ArcAppWindowLauncherItemController::RemoveTaskId(int task_id) {
+ task_ids_.erase(task_id);
+}
+
+ash::ShelfItemDelegate::PerformedAction
+ArcAppWindowLauncherItemController::ItemSelected(const ui::Event& event) {
+ if (window_count()) {
+ return AppWindowLauncherItemController::ItemSelected(event);
+ } else {
+ if (task_ids_.empty()) {
+ NOTREACHED();
+ return kNoAction;
+ }
+ arc::SetTaskActive(*task_ids_.begin());
+ return kNewWindowCreated;
+ }
+}
+
base::string16 ArcAppWindowLauncherItemController::GetTitle() {
ArcAppListPrefs* arc_prefs =
ArcAppListPrefs::Get(launcher_controller()->GetProfile());

Powered by Google App Engine
This is Rietveld 408576698