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

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

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge Created 3 years, 9 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/common/shelf/shelf_delegate.h" 8 #include "ash/common/shelf/shelf_delegate.h"
9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (arc::IsArcAllowedForProfile(owner->profile())) { 257 if (arc::IsArcAllowedForProfile(owner->profile())) {
258 observed_profile_ = owner->profile(); 258 observed_profile_ = owner->profile();
259 StartObserving(observed_profile_); 259 StartObserving(observed_profile_);
260 } 260 }
261 } 261 }
262 262
263 ArcAppWindowLauncherController::~ArcAppWindowLauncherController() { 263 ArcAppWindowLauncherController::~ArcAppWindowLauncherController() {
264 if (observed_profile_) 264 if (observed_profile_)
265 StopObserving(observed_profile_); 265 StopObserving(observed_profile_);
266 if (observing_shell_) 266 if (observing_shell_)
267 ash::WmShell::Get()->RemoveShellObserver(this); 267 ash::Shell::GetInstance()->RemoveShellObserver(this);
268 } 268 }
269 269
270 // static 270 // static
271 std::string ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId( 271 std::string ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(
272 const std::string& arc_app_id) { 272 const std::string& arc_app_id) {
273 return arc_app_id == arc::kPlayStoreAppId ? ArcSupportHost::kHostAppId 273 return arc_app_id == arc::kPlayStoreAppId ? ArcSupportHost::kHostAppId
274 : arc_app_id; 274 : arc_app_id;
275 } 275 }
276 276
277 // static 277 // static
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 aura::Window* window) { 391 aura::Window* window) {
392 const int task_id = GetWindowTaskId(window); 392 const int task_id = GetWindowTaskId(window);
393 if (task_id <= 0) 393 if (task_id <= 0)
394 return; 394 return;
395 395
396 // We need to add the observer after exo started observing shell 396 // We need to add the observer after exo started observing shell
397 // because we want to update the orientation after exo send 397 // because we want to update the orientation after exo send
398 // the layout switch information. 398 // the layout switch information.
399 if (!observing_shell_) { 399 if (!observing_shell_) {
400 observing_shell_ = true; 400 observing_shell_ = true;
401 ash::WmShell::Get()->AddShellObserver(this); 401 ash::Shell::GetInstance()->AddShellObserver(this);
402 } 402 }
403 403
404 // Check if we have controller for this task. 404 // Check if we have controller for this task.
405 if (GetAppWindowForTask(task_id)) 405 if (GetAppWindowForTask(task_id))
406 return; 406 return;
407 407
408 window->SetProperty(aura::client::kAppType, 408 window->SetProperty(aura::client::kAppType,
409 static_cast<int>(ash::AppType::ARC_APP)); 409 static_cast<int>(ash::AppType::ARC_APP));
410 410
411 // Create controller if we have task info. 411 // Create controller if we have task info.
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); 718 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window);
719 if (arc_app_id.empty()) 719 if (arc_app_id.empty())
720 return -1; 720 return -1;
721 721
722 int task_id = -1; 722 int task_id = -1;
723 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) 723 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1)
724 return -1; 724 return -1;
725 725
726 return task_id; 726 return task_id;
727 } 727 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698