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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 int task_id = -1; | 282 int task_id = -1; |
283 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) |
284 return; | 284 return; |
285 | 285 |
286 if (task_id) { | 286 if (task_id) { |
287 AppWindow* app_window = GetAppWindowForTask(task_id); | 287 AppWindow* app_window = GetAppWindowForTask(task_id); |
288 if (app_window) { | 288 if (app_window) { |
289 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); | 290 ash::SetShelfIDForWindow(app_window->shelf_id(), window); |
291 if (app_window->controller()) | |
292 window->SetTitle(app_window->controller()->GetTitle()); | |
293 chrome::MultiUserWindowManager::GetInstance()->SetWindowOwner( | 291 chrome::MultiUserWindowManager::GetInstance()->SetWindowOwner( |
294 window, | 292 window, |
295 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId()); | 293 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId()); |
296 } | 294 } |
297 } | 295 } |
298 } | 296 } |
299 | 297 |
300 void ArcAppWindowLauncherController::OnAppReadyChanged( | 298 void ArcAppWindowLauncherController::OnAppReadyChanged( |
301 const std::string& app_id, | 299 const std::string& app_id, |
302 bool ready) { | 300 bool ready) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 468 |
471 ArcAppWindowLauncherItemController* controller = it->second; | 469 ArcAppWindowLauncherItemController* controller = it->second; |
472 controller->RemoveWindow(app_window); | 470 controller->RemoveWindow(app_window); |
473 if (!controller->window_count()) { | 471 if (!controller->window_count()) { |
474 ash::ShelfID shelf_id = app_window->shelf_id(); | 472 ash::ShelfID shelf_id = app_window->shelf_id(); |
475 owner()->CloseLauncherItem(shelf_id); | 473 owner()->CloseLauncherItem(shelf_id); |
476 app_controller_map_.erase(it); | 474 app_controller_map_.erase(it); |
477 } | 475 } |
478 app_window->ResetController(); | 476 app_window->ResetController(); |
479 } | 477 } |
OLD | NEW |