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

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

Issue 2282023002: arc: Support window recreation. (Closed)
Patch Set: use SetTaskActive instead of Launch 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 7524f30c2d34bf140b4ea7a8c5599d8338cf2e98..a391652639f331b6b3b83df2e84d77641df76638 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& eent) {
Mr4D (OOO till 08-26) 2016/08/26 22:54:43 event?
khmel 2016/08/29 16:41:04 Done.
+ if (window_count()) {
+ return AppWindowLauncherItemController::ItemSelected(eent);
+ } 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