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

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc

Issue 2101883002: ARC: Wire minimizing windows from shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix animations. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" 4 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
5 5
6 #include "ash/common/wm/window_state.h" 6 #include "ash/common/wm/window_state.h"
7 #include "ash/shelf/shelf_delegate.h" 7 #include "ash/shelf/shelf_delegate.h"
8 #include "ash/shelf/shelf_util.h" 8 #include "ash/shelf/shelf_util.h"
9 #include "ash/wm/window_state_aura.h" 9 #include "ash/wm/window_state_aura.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 app_instance->SetTaskActive(task_id_); 131 app_instance->SetTaskActive(task_id_);
132 if (widget_) 132 if (widget_)
133 widget_->Activate(); 133 widget_->Activate();
134 } 134 }
135 135
136 void Deactivate() override { NOTREACHED(); } 136 void Deactivate() override { NOTREACHED(); }
137 137
138 void Maximize() override { NOTREACHED(); } 138 void Maximize() override { NOTREACHED(); }
139 139
140 void Minimize() override { 140 void Minimize() override {
141 // TODO(khmel): support window minimizing. 141 if (widget_)
142 widget_->Minimize();
142 } 143 }
143 144
144 void Restore() override { NOTREACHED(); } 145 void Restore() override { NOTREACHED(); }
145 146
146 void SetBounds(const gfx::Rect& bounds) override { NOTREACHED(); } 147 void SetBounds(const gfx::Rect& bounds) override { NOTREACHED(); }
147 148
148 void FlashFrame(bool flash) override { NOTREACHED(); } 149 void FlashFrame(bool flash) override { NOTREACHED(); }
149 150
150 bool IsAlwaysOnTop() const override { 151 bool IsAlwaysOnTop() const override {
151 NOTREACHED(); 152 NOTREACHED();
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return; 280 return;
280 281
281 int task_id = -1; 282 int task_id = -1;
282 if (sscanf(app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) 283 if (sscanf(app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1)
283 return; 284 return;
284 285
285 if (task_id) { 286 if (task_id) {
286 AppWindow* app_window = GetAppWindowForTask(task_id); 287 AppWindow* app_window = GetAppWindowForTask(task_id);
287 if (app_window) { 288 if (app_window) {
288 app_window->set_widget(views::Widget::GetWidgetForNativeWindow(window)); 289 app_window->set_widget(views::Widget::GetWidgetForNativeWindow(window));
290 ash::SetShelfIDForWindow(app_window->shelf_id(), window);
289 if (app_window->controller()) 291 if (app_window->controller())
290 window->SetTitle(app_window->controller()->GetTitle()); 292 window->SetTitle(app_window->controller()->GetTitle());
291 chrome::MultiUserWindowManager::GetInstance()->SetWindowOwner( 293 chrome::MultiUserWindowManager::GetInstance()->SetWindowOwner(
292 window, 294 window,
293 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId()); 295 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId());
294 } 296 }
295 } 297 }
296 } 298 }
297 299
298 void ArcAppWindowLauncherController::OnAppReadyChanged( 300 void ArcAppWindowLauncherController::OnAppReadyChanged(
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 470
469 ArcAppWindowLauncherItemController* controller = it->second; 471 ArcAppWindowLauncherItemController* controller = it->second;
470 controller->RemoveWindow(app_window); 472 controller->RemoveWindow(app_window);
471 if (!controller->window_count()) { 473 if (!controller->window_count()) {
472 ash::ShelfID shelf_id = app_window->shelf_id(); 474 ash::ShelfID shelf_id = app_window->shelf_id();
473 owner()->CloseLauncherItem(shelf_id); 475 owner()->CloseLauncherItem(shelf_id);
474 app_controller_map_.erase(it); 476 app_controller_map_.erase(it);
475 } 477 }
476 app_window->ResetController(); 478 app_window->ResetController();
477 } 479 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698