| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |