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

Unified Diff: ash/wm/ash_activation_controller.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/ash_activation_controller.cc
diff --git a/ash/wm/ash_activation_controller.cc b/ash/wm/ash_activation_controller.cc
index 261bd628c3ed5242de71ee8d0a4bd870296892a7..f8c338a17815ea4e36514bac595be0ac2fd4207a 100644
--- a/ash/wm/ash_activation_controller.cc
+++ b/ash/wm/ash_activation_controller.cc
@@ -6,6 +6,7 @@
#include "ash/launcher/launcher.h"
#include "ash/root_window_controller.h"
+#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/wm/activation_controller.h"
@@ -94,24 +95,16 @@ aura::Window* AshActivationController::PrepareToActivateLauncher() {
// Fallback to a launcher only when Spoken feedback is enabled.
if (!Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled())
return NULL;
- Launcher* launcher;
- if (Shell::IsLauncherPerDisplayEnabled()) {
- launcher = GetRootWindowController(
- Shell::GetActiveRootWindow())->launcher();
- } else {
- launcher = Launcher::ForPrimaryDisplay();
- }
- // Launcher is not always available, eg. not in the login screen.
- if (!launcher)
- return NULL;
- views::Widget* launcher_widget = launcher->widget();
+ ShelfWidget* shelf = GetRootWindowController(
+ Shell::IsLauncherPerDisplayEnabled() ?
+ Shell::GetActiveRootWindow() :
+ Shell::GetPrimaryRootWindow())->shelf();
// Launcher's window may be already destroyed in shutting down process.
- if (!launcher_widget)
+ if (!shelf)
return NULL;
- aura::Window* launcher_window = launcher_widget->GetNativeWindow();
// Notify launcher to allow activation via CanActivate().
- launcher->WillActivateAsFallback();
- return launcher_window;
+ shelf->WillActivateAsFallback();
+ return shelf->GetNativeWindow();
}
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698