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 <string> | 6 #include <string> |
7 | 7 |
8 #include "ash/display/screen_orientation_controller_chromeos.h" | 8 #include "ash/display/screen_orientation_controller_chromeos.h" |
9 #include "ash/public/cpp/shelf_model.h" | 9 #include "ash/public/cpp/shelf_model.h" |
10 #include "ash/public/cpp/window_properties.h" | 10 #include "ash/public/cpp/window_properties.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // the layout switch information. | 281 // the layout switch information. |
282 if (!observing_shell_) { | 282 if (!observing_shell_) { |
283 observing_shell_ = true; | 283 observing_shell_ = true; |
284 ash::Shell::Get()->AddShellObserver(this); | 284 ash::Shell::Get()->AddShellObserver(this); |
285 } | 285 } |
286 | 286 |
287 // Check if we have controller for this task. | 287 // Check if we have controller for this task. |
288 if (GetAppWindowForTask(task_id)) | 288 if (GetAppWindowForTask(task_id)) |
289 return; | 289 return; |
290 | 290 |
| 291 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_APP); |
291 window->SetProperty(aura::client::kAppType, | 292 window->SetProperty(aura::client::kAppType, |
292 static_cast<int>(ash::AppType::ARC_APP)); | 293 static_cast<int>(ash::AppType::ARC_APP)); |
293 | 294 |
294 // Create controller if we have task info. | 295 // Create controller if we have task info. |
295 AppWindowInfo* info = GetAppWindowInfoForTask(task_id); | 296 AppWindowInfo* info = GetAppWindowInfoForTask(task_id); |
296 if (!info) { | 297 if (!info) { |
297 VLOG(1) << "Could not find AppWindowInfo for task:" << task_id; | 298 VLOG(1) << "Could not find AppWindowInfo for task:" << task_id; |
298 return; | 299 return; |
299 } | 300 } |
300 | 301 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 const std::string* arc_app_id = exo::ShellSurface::GetApplicationId(window); | 652 const std::string* arc_app_id = exo::ShellSurface::GetApplicationId(window); |
652 if (!arc_app_id) | 653 if (!arc_app_id) |
653 return -1; | 654 return -1; |
654 | 655 |
655 int task_id = -1; | 656 int task_id = -1; |
656 if (sscanf(arc_app_id->c_str(), "org.chromium.arc.%d", &task_id) != 1) | 657 if (sscanf(arc_app_id->c_str(), "org.chromium.arc.%d", &task_id) != 1) |
657 return -1; | 658 return -1; |
658 | 659 |
659 return task_id; | 660 return task_id; |
660 } | 661 } |
OLD | NEW |