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

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

Issue 2878133002: mash: Serialize ShelfIDs for property conversion and transport. (Closed)
Patch Set: Address comments. Created 3 years, 7 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
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 <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/window_properties.h" 9 #include "ash/public/cpp/window_properties.h"
10 #include "ash/shared/app_types.h" 10 #include "ash/shared/app_types.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 return; 411 return;
412 } 412 }
413 413
414 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); 414 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
415 DCHECK(widget); 415 DCHECK(widget);
416 DCHECK(!info->app_window()); 416 DCHECK(!info->app_window());
417 info->set_app_window( 417 info->set_app_window(
418 base::MakeUnique<AppWindow>(task_id, info->app_shelf_id(), widget, this)); 418 base::MakeUnique<AppWindow>(task_id, info->app_shelf_id(), widget, this));
419 RegisterApp(info); 419 RegisterApp(info);
420 DCHECK(info->app_window()->controller()); 420 DCHECK(info->app_window()->controller());
421 window->SetProperty(ash::kShelfIDKey, 421 const ash::ShelfID shelf_id(info->app_window()->shelf_id());
422 new ash::ShelfID(info->app_window()->shelf_id())); 422 window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize()));
423 if (ash::Shell::Get() 423 if (ash::Shell::Get()
424 ->maximize_mode_controller() 424 ->maximize_mode_controller()
425 ->IsMaximizeModeWindowManagerEnabled()) { 425 ->IsMaximizeModeWindowManagerEnabled()) {
426 SetOrientationLockForAppWindow(info->app_window()); 426 SetOrientationLockForAppWindow(info->app_window());
427 } 427 }
428 } 428 }
429 429
430 void ArcAppWindowLauncherController::OnAppReadyChanged( 430 void ArcAppWindowLauncherController::OnAppReadyChanged(
431 const std::string& arc_app_id, 431 const std::string& arc_app_id,
432 bool ready) { 432 bool ready) {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); 733 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window);
734 if (arc_app_id.empty()) 734 if (arc_app_id.empty())
735 return -1; 735 return -1;
736 736
737 int task_id = -1; 737 int task_id = -1;
738 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) 738 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1)
739 return -1; 739 return -1;
740 740
741 return task_id; 741 return task_id;
742 } 742 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698