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

Unified Diff: ash/system/tray/system_tray.h

Issue 10381132: Allow Uber Tray popup pointing to the related tray item view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & offset position fix Created 8 years, 7 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/system/tray/system_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.h
diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h
index 8bfbdac351806eae8c7c347b5beeb1a132252777..24e8257e3ef94eaddda38f23ea5fc1d267c9417d 100644
--- a/ash/system/tray/system_tray.h
+++ b/ash/system/tray/system_tray.h
@@ -16,6 +16,7 @@
#include "base/memory/scoped_vector.h"
#include "ui/views/view.h"
+#include <map>
#include <vector>
namespace ash {
@@ -154,11 +155,20 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
const ScopedVector<SystemTrayItem>& items() const { return items_; }
+ // Calculates the x-offset for the item in the tray. Returns -1 if its tray
+ // item view is not visible.
+ int GetTrayXOffset(SystemTrayItem* item) const;
+
+ // Shows the default view and its arrow position is shifted by |x_offset|.
+ void ShowDefaultViewWithOffset(BubbleCreationType creation_type,
+ int x_offset);
+
// Constructs or re-constructs |bubble_| and populates it with |items|.
void ShowItems(const std::vector<SystemTrayItem*>& items,
bool details,
bool activate,
- BubbleCreationType creation_type);
+ BubbleCreationType creation_type,
+ int x_offset);
// Constructs or re-constructs |notification_bubble_| and populates it with
// |notification_items_|, or destroys it if there are no notification items.
@@ -187,6 +197,9 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
// The container for all the tray views of the items.
views::View* tray_container_;
+ // Mappings of system tray item and it's view in the tray.
+ std::map<SystemTrayItem*, views::View*> tray_item_map_;
+
// These observers are not owned by the tray.
AccessibilityObserver* accessibility_observer_;
AudioObserver* audio_observer_;
« no previous file with comments | « no previous file | ash/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698