Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 4 |
| 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 563 ash::MultiProfileUMA::RecordTeleportAction( | 563 ash::MultiProfileUMA::RecordTeleportAction( |
| 564 ash::MultiProfileUMA::TELEPORT_WINDOW_RETURN_BY_LAUNCHER); | 564 ash::MultiProfileUMA::TELEPORT_WINDOW_RETURN_BY_LAUNCHER); |
| 565 manager->ShowWindowForUser(native_window, current_account_id); | 565 manager->ShowWindowForUser(native_window, current_account_id); |
| 566 window->Activate(); | 566 window->Activate(); |
| 567 return ash::SHELF_ACTION_WINDOW_ACTIVATED; | 567 return ash::SHELF_ACTION_WINDOW_ACTIVATED; |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 | 570 |
| 571 if (window->IsActive() && allow_minimize) { | 571 if (window->IsActive() && allow_minimize) { |
| 572 window->Minimize(); | 572 window->Minimize(); |
| 573 return ash::SHELF_ACTION_NONE; | 573 return ash::SHELF_ACTION_WINDOW_MINIMIZED; |
|
James Cook
2017/03/09 01:09:47
Weird that it was NONE before. Was that a bug?
msw
2017/03/10 06:17:57
Yeah, it seems so... the difference between these
| |
| 574 } | 574 } |
| 575 | 575 |
| 576 window->Show(); | 576 window->Show(); |
| 577 window->Activate(); | 577 window->Activate(); |
| 578 return ash::SHELF_ACTION_WINDOW_ACTIVATED; | 578 return ash::SHELF_ACTION_WINDOW_ACTIVATED; |
| 579 } | 579 } |
| 580 | 580 |
| 581 void ChromeLauncherControllerImpl::ActiveUserChanged( | 581 void ChromeLauncherControllerImpl::ActiveUserChanged( |
| 582 const std::string& user_email) { | 582 const std::string& user_email) { |
| 583 // Store the order of running applications for the user which gets inactive. | 583 // Store the order of running applications for the user which gets inactive. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 608 ash::Shell::GetInstance()->CreateKeyboard(); | 608 ash::Shell::GetInstance()->CreateKeyboard(); |
| 609 } | 609 } |
| 610 | 610 |
| 611 void ChromeLauncherControllerImpl::AdditionalUserAddedToSession( | 611 void ChromeLauncherControllerImpl::AdditionalUserAddedToSession( |
| 612 Profile* profile) { | 612 Profile* profile) { |
| 613 // Switch the running applications to the new user. | 613 // Switch the running applications to the new user. |
| 614 for (auto& controller : app_window_controllers_) | 614 for (auto& controller : app_window_controllers_) |
| 615 controller->AdditionalUserAddedToSession(profile); | 615 controller->AdditionalUserAddedToSession(profile); |
| 616 } | 616 } |
| 617 | 617 |
| 618 ash::ShelfAppMenuItemList | 618 ash::ShelfItemDelegate::MenuItemList |
| 619 ChromeLauncherControllerImpl::GetAppMenuItemsForTesting( | 619 ChromeLauncherControllerImpl::GetAppMenuItemsForTesting( |
| 620 const ash::ShelfItem& item) { | 620 const ash::ShelfItem& item) { |
| 621 LauncherItemController* controller = GetLauncherItemController(item.id); | 621 LauncherItemController* controller = GetLauncherItemController(item.id); |
| 622 return controller ? controller->GetAppMenuItems(ui::EF_NONE) | 622 return controller ? controller->GetAppMenuItems(ui::EF_NONE) |
| 623 : ash::ShelfAppMenuItemList(); | 623 : ash::ShelfItemDelegate::MenuItemList(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 std::vector<content::WebContents*> | 626 std::vector<content::WebContents*> |
| 627 ChromeLauncherControllerImpl::GetV1ApplicationsFromAppId( | 627 ChromeLauncherControllerImpl::GetV1ApplicationsFromAppId( |
| 628 const std::string& app_id) { | 628 const std::string& app_id) { |
| 629 const ash::ShelfItem* item = GetItem(GetShelfIDForAppID(app_id)); | 629 const ash::ShelfItem* item = GetItem(GetShelfIDForAppID(app_id)); |
| 630 // If there is no such item pinned to the launcher, no menu gets created. | 630 // If there is no such item pinned to the launcher, no menu gets created. |
| 631 if (!item || item->type != ash::TYPE_APP_SHORTCUT) | 631 if (!item || item->type != ash::TYPE_APP_SHORTCUT) |
| 632 return std::vector<content::WebContents*>(); | 632 return std::vector<content::WebContents*>(); |
| 633 LauncherItemController* controller = GetLauncherItemController(item->id); | 633 LauncherItemController* controller = GetLauncherItemController(item->id); |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1490 LauncherItemController* controller = GetLauncherItemController(item.id); | 1490 LauncherItemController* controller = GetLauncherItemController(item.id); |
| 1491 if (!controller || controller->image_set_by_controller()) | 1491 if (!controller || controller->image_set_by_controller()) |
| 1492 continue; | 1492 continue; |
| 1493 item.image = image; | 1493 item.image = image; |
| 1494 if (arc_deferred_launcher_) | 1494 if (arc_deferred_launcher_) |
| 1495 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1495 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
| 1496 model_->Set(index, item); | 1496 model_->Set(index, item); |
| 1497 // It's possible we're waiting on more than one item, so don't break. | 1497 // It's possible we're waiting on more than one item, so don't break. |
| 1498 } | 1498 } |
| 1499 } | 1499 } |
| OLD | NEW |