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

Unified Diff: ash/launcher/launcher.h

Issue 11451002: Focus launcher if spoken feedback is enabled and no other windows visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit tests. Created 8 years 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/launcher/launcher.h
diff --git a/ash/launcher/launcher.h b/ash/launcher/launcher.h
index 7db8f50db5bcd8e6bece96b4aae1e92c892e3580..1a525cd7d7d587bf9f0088ab2ee39868f7b57b88 100644
--- a/ash/launcher/launcher.h
+++ b/ash/launcher/launcher.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/size.h"
+#include "ui/views/widget/widget_observer.h"
namespace aura {
class Window;
@@ -38,7 +39,7 @@ class LauncherIconObserver;
class LauncherDelegate;
class LauncherModel;
-class ASH_EXPORT Launcher {
+class ASH_EXPORT Launcher: public views::WidgetObserver {
public:
Launcher(aura::Window* window_container,
internal::ShelfLayoutManager* shelf_layout_manager);
@@ -110,6 +111,9 @@ class ASH_EXPORT Launcher {
// TODO(sky): remove this!
internal::LauncherView* GetLauncherViewForTest();
+ // Overridden from views::WidgetObserver:
+ void OnWidgetActivationChanged(views::Widget* widget, bool active) OVERRIDE;
+
LauncherDelegate* delegate() { return delegate_.get(); }
LauncherModel* model() { return model_.get(); }
@@ -119,6 +123,10 @@ class ASH_EXPORT Launcher {
aura::Window* window_container() { return window_container_; }
+ // Called by the activation delegate, before the launcher is activated
+ // when no other windows are visible.
+ void WillActivateAsFallback() { activating_as_fallback_ = true; }
+
private:
class DelegateView;
@@ -146,6 +154,9 @@ class ASH_EXPORT Launcher {
// Used to animate the background.
internal::BackgroundAnimator background_animator_;
+ // Used then activation is forced from the activation delegate.
+ bool activating_as_fallback_;
+
DISALLOW_COPY_AND_ASSIGN(Launcher);
};

Powered by Google App Engine
This is Rietveld 408576698