OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 nullptr, ash::Shell::Get()->shelf_model()); | 503 nullptr, ash::Shell::Get()->shelf_model()); |
504 launcher_controller_->Init(); | 504 launcher_controller_->Init(); |
505 } | 505 } |
506 } | 506 } |
507 | 507 |
508 void ChromeShellDelegate::ShelfShutdown() { | 508 void ChromeShellDelegate::ShelfShutdown() { |
509 launcher_controller_.reset(); | 509 launcher_controller_.reset(); |
510 } | 510 } |
511 | 511 |
512 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( | 512 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( |
513 ash::WmShelf* wm_shelf, | 513 ash::Shelf* shelf, |
514 const ash::ShelfItem* item) { | 514 const ash::ShelfItem* item) { |
515 // Don't show context menu for exclusive app runtime mode. | 515 // Don't show context menu for exclusive app runtime mode. |
516 if (chrome::IsRunningInAppMode()) | 516 if (chrome::IsRunningInAppMode()) |
517 return nullptr; | 517 return nullptr; |
518 | 518 |
519 // No context menu before |launcher_controller_| is created. This is possible | 519 // No context menu before |launcher_controller_| is created. This is possible |
520 // now because ShelfInit() is called by session state change via mojo | 520 // now because ShelfInit() is called by session state change via mojo |
521 // asynchronously. Context menu could be triggered when the mojo message is | 521 // asynchronously. Context menu could be triggered when the mojo message is |
522 // still in-fly and crashes. | 522 // still in-fly and crashes. |
523 if (!launcher_controller_) | 523 if (!launcher_controller_) |
524 return nullptr; | 524 return nullptr; |
525 | 525 |
526 return LauncherContextMenu::Create(launcher_controller_.get(), item, | 526 return LauncherContextMenu::Create(launcher_controller_.get(), item, shelf); |
527 wm_shelf); | |
528 } | 527 } |
529 | 528 |
530 ash::GPUSupport* ChromeShellDelegate::CreateGPUSupport() { | 529 ash::GPUSupport* ChromeShellDelegate::CreateGPUSupport() { |
531 // Chrome uses real GPU support. | 530 // Chrome uses real GPU support. |
532 return new ash::GPUSupportImpl; | 531 return new ash::GPUSupportImpl; |
533 } | 532 } |
534 | 533 |
535 base::string16 ChromeShellDelegate::GetProductName() const { | 534 base::string16 ChromeShellDelegate::GetProductName() const { |
536 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 535 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
537 } | 536 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 NOTREACHED() << "Unexpected notification " << type; | 644 NOTREACHED() << "Unexpected notification " << type; |
646 } | 645 } |
647 } | 646 } |
648 | 647 |
649 void ChromeShellDelegate::PlatformInit() { | 648 void ChromeShellDelegate::PlatformInit() { |
650 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 649 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
651 content::NotificationService::AllSources()); | 650 content::NotificationService::AllSources()); |
652 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 651 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
653 content::NotificationService::AllSources()); | 652 content::NotificationService::AllSources()); |
654 } | 653 } |
OLD | NEW |