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

Unified Diff: ash/wm/panel_layout_manager.h

Issue 10174037: Implement a callout widget for the active panel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase? Created 8 years, 8 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
« no previous file with comments | « no previous file | ash/wm/panel_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panel_layout_manager.h
diff --git a/ash/wm/panel_layout_manager.h b/ash/wm/panel_layout_manager.h
index 11f9502c59410c8afaa9d8b69a1cd6ca933bf454..938411c83a5189834d6fdfd9cd88a9cb896eead9 100644
--- a/ash/wm/panel_layout_manager.h
+++ b/ash/wm/panel_layout_manager.h
@@ -12,6 +12,8 @@
#include "ash/launcher/launcher_icon_observer.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window_observer.h"
@@ -23,6 +25,10 @@ namespace gfx {
class Rect;
}
+namespace views {
+class Widget;
+}
+
namespace ash {
class Launcher;
@@ -69,6 +75,8 @@ class ASH_EXPORT PanelLayoutManager : public aura::LayoutManager,
aura::Window* window, const void* key, intptr_t old) OVERRIDE;
private:
+ friend class PanelLayoutManagerTest;
+
typedef std::list<aura::Window*> PanelList;
// Called whenever the panel layout might change.
@@ -78,6 +86,21 @@ class ASH_EXPORT PanelLayoutManager : public aura::LayoutManager,
// changes or a panel is moved).
void UpdateStacking(aura::Window* active_panel);
+ // Trigger a delayed task to update the callout. We use this because
+ // otherwise, ShadowController::OnWindowPropertyChanged may be invoked after
+ // we've already updated the callout, causing the drop shadow to be stacked on
+ // top of the callout rather than the other way around.
+ // TODO(dcheng): Possibly a bug in the shadow controller. If a window is
+ // focused but not stacked at the top, I don't think its shadow should be
+ // drawn on top of "higher" windows.
+ void UpdateCallout(aura::Window* active_window);
+
+ // Don't call this directly. Only UpdateCallout() should call this method.
+ void ShowCalloutHelper(aura::Window* active_panel);
+
+ // For testing.
+ views::Widget* callout_widget() const { return callout_widget_.get(); }
+
// Parent window associated with this layout manager.
aura::Window* panel_container_;
// Protect against recursive calls to Relayout().
@@ -91,6 +114,9 @@ class ASH_EXPORT PanelLayoutManager : public aura::LayoutManager,
// The last active panel. Used to maintain stacking even if no panels are
// currently focused.
aura::Window* last_active_panel_;
+ // Manage the callout for the focused panel, if any.
+ scoped_ptr<views::Widget> callout_widget_;
+ base::WeakPtrFactory<PanelLayoutManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager);
};
« no previous file with comments | « no previous file | ash/wm/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698