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

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

Issue 2281743002: arc: Add support of default and OEM apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactored Created 4 years, 3 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if (it == task_id_to_task_info_.end()) 377 if (it == task_id_to_task_info_.end())
378 return; 378 return;
379 379
380 const TaskInfo& task_info = *it->second; 380 const TaskInfo& task_info = *it->second;
381 const std::string app_id = 381 const std::string app_id =
382 GetShelfAppIdFromArcAppId(ArcAppListPrefs::GetAppId( 382 GetShelfAppIdFromArcAppId(ArcAppListPrefs::GetAppId(
383 task_info.package_name, task_info.activity_name)); 383 task_info.package_name, task_info.activity_name));
384 384
385 std::unique_ptr<AppWindow> app_window(new AppWindow(task_id, app_id, this)); 385 std::unique_ptr<AppWindow> app_window(new AppWindow(task_id, app_id, this));
386 app_window->set_widget(views::Widget::GetWidgetForNativeWindow(window)); 386 app_window->set_widget(views::Widget::GetWidgetForNativeWindow(window));
387
Mr4D (OOO till 08-26) 2016/08/30 20:21:46 Can you please remove this line (which would make
khmel 2016/08/30 21:22:11 Done.
387 RegisterApp(app_window.get()); 388 RegisterApp(app_window.get());
388 DCHECK(app_window->controller()); 389 DCHECK(app_window->controller());
389 ash::SetShelfIDForWindow(app_window->shelf_id(), window); 390 ash::SetShelfIDForWindow(app_window->shelf_id(), window);
390 chrome::MultiUserWindowManager::GetInstance()->SetWindowOwner( 391 chrome::MultiUserWindowManager::GetInstance()->SetWindowOwner(
391 window, 392 window,
392 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId()); 393 user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId());
393 if (ash::WmShell::Get() 394 if (ash::WmShell::Get()
394 ->maximize_mode_controller() 395 ->maximize_mode_controller()
395 ->IsMaximizeModeWindowManagerEnabled()) { 396 ->IsMaximizeModeWindowManagerEnabled()) {
396 SetOrientationLockForAppWindow(app_window.get()); 397 SetOrientationLockForAppWindow(app_window.get());
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) { 630 if (orientation_lock == arc::mojom::OrientationLock::CURRENT) {
630 // Resolve the orientation when it first resolved. 631 // Resolve the orientation when it first resolved.
631 orientation_lock = GetCurrentOrientation(); 632 orientation_lock = GetCurrentOrientation();
632 app_window->set_requested_orientation_lock(orientation_lock); 633 app_window->set_requested_orientation_lock(orientation_lock);
633 } 634 }
634 635
635 ash::Shell* shell = ash::Shell::GetInstance(); 636 ash::Shell* shell = ash::Shell::GetInstance();
636 shell->screen_orientation_controller()->LockOrientationForWindow( 637 shell->screen_orientation_controller()->LockOrientationForWindow(
637 window, BlinkOrientationLockFromMojom(orientation_lock)); 638 window, BlinkOrientationLockFromMojom(orientation_lock));
638 } 639 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698