Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / ash / system / tray / system_tray.h
index 7b1681d..301ef13 100644 (file)
 #include <vector>
 
 namespace ash {
-
+class ScreenTrayItem;
+class SystemBubbleWrapper;
 class SystemTrayDelegate;
 class SystemTrayItem;
-
-namespace internal {
-class SystemBubbleWrapper;
 class TrayAccessibility;
 class TrayDate;
 class TrayUser;
-}
 
 // There are different methods for creating bubble views.
 enum BubbleCreationType {
@@ -37,10 +34,10 @@ enum BubbleCreationType {
   BUBBLE_USE_EXISTING,  // Uses any existing bubble, or creates a new one.
 };
 
-class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
+class ASH_EXPORT SystemTray : public TrayBackgroundView,
                               public views::TrayBubbleView::Delegate {
  public:
-  explicit SystemTray(internal::StatusAreaWidget* status_area_widget);
+  explicit SystemTray(StatusAreaWidget* status_area_widget);
   virtual ~SystemTray();
 
   // Calls TrayBackgroundView::Initialize(), creates the tray items, and
@@ -56,9 +53,6 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   // Returns all tray items that has been added to system tray.
   const std::vector<SystemTrayItem*>& GetTrayItems() const;
 
-  // Returns all tray user items that were added to the system tray.
-  const std::vector<internal::TrayUser*>& GetTrayUserItems() const;
-
   // Shows the default view of all items.
   void ShowDefaultView(BubbleCreationType creation_type);
 
@@ -94,8 +88,8 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   // Temporarily hides/unhides the notification bubble.
   void SetHideNotifications(bool hidden);
 
-  // Returns true if the launcher should be forced visible when auto-hidden.
-  bool ShouldShowLauncher() const;
+  // Returns true if the shelf should be forced visible when auto-hidden.
+  bool ShouldShowShelf() const;
 
   // Returns true if there is a system bubble (already visible or in the process
   // of being created).
@@ -105,10 +99,10 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   bool HasNotificationBubble() const;
 
   // Returns true if the system_bubble_ exists and is of type |type|.
-  bool HasSystemBubbleType(internal::SystemTrayBubble::BubbleType type);
+  bool HasSystemBubbleType(SystemTrayBubble::BubbleType type);
 
   // Returns a pointer to the system bubble or NULL if none.
-  internal::SystemTrayBubble* GetSystemBubble();
+  SystemTrayBubble* GetSystemBubble();
 
   // Returns true if any bubble is visible.
   bool IsAnyBubbleVisible() const;
@@ -142,21 +136,24 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   virtual void OnMouseEnteredView() OVERRIDE;
   virtual void OnMouseExitedView() OVERRIDE;
   virtual base::string16 GetAccessibleNameForBubble() OVERRIDE;
-  virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget,
-                                  AnchorType anchor_type,
-                                  AnchorAlignment anchor_alignment) OVERRIDE;
+  virtual gfx::Rect GetAnchorRect(
+      views::Widget* anchor_widget,
+      AnchorType anchor_type,
+      AnchorAlignment anchor_alignment) const OVERRIDE;
   virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE;
 
-  internal::TrayAccessibility* GetTrayAccessibilityForTest() {
+  ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; }
+  ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; }
+
+  TrayAccessibility* GetTrayAccessibilityForTest() {
     return tray_accessibility_;
   }
 
   // Get the tray item view (or NULL) for a given |tray_item| in a unit test.
   views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item);
 
-  // Add a tray user item for testing purposes. Note: The passed |tray_user|
-  // will be owned by the SystemTray after the call.
-  void AddTrayUserItemForTest(internal::TrayUser* tray_user);
+  // Gets tray_date_ for browser tests.
+  TrayDate* GetTrayDateForTesting() const;
 
  private:
   // Creates the default set of items for the sytem tray.
@@ -168,6 +165,10 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   // Resets |notification_bubble_| and clears any related state.
   void DestroyNotificationBubble();
 
+  // Returns a string with the current time for accessibility on the status
+  // tray bar.
+  base::string16 GetAccessibleTimeString(const base::Time& now) const;
+
   // 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;
@@ -200,16 +201,12 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
 
   const ScopedVector<SystemTrayItem>& items() const { return items_; }
 
-  // Overridden from internal::ActionableView.
+  // Overridden from ActionableView.
   virtual bool PerformAction(const ui::Event& event) OVERRIDE;
 
   // Owned items.
   ScopedVector<SystemTrayItem> items_;
 
-  // User items - note, this is a subset of the |items_| list. Note that no
-  // item in this list needs to be deleted.
-  std::vector<internal::TrayUser*> user_items_;
-
   // Pointers to members of |items_|.
   SystemTrayItem* detailed_item_;
   std::vector<SystemTrayItem*> notification_items_;
@@ -218,10 +215,10 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   std::map<SystemTrayItem*, views::View*> tray_item_map_;
 
   // Bubble for default and detailed views.
-  scoped_ptr<internal::SystemBubbleWrapper> system_bubble_;
+  scoped_ptr<SystemBubbleWrapper> system_bubble_;
 
   // Bubble for notifications.
-  scoped_ptr<internal::SystemBubbleWrapper> notification_bubble_;
+  scoped_ptr<SystemBubbleWrapper> notification_bubble_;
 
   // Keep track of the default view height so that when we create detailed
   // views directly (e.g. from a notification) we know what height to use.
@@ -236,8 +233,12 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView,
   // Note that the value is only valid when |system_bubble_| is true.
   bool full_system_tray_menu_;
 
-  internal::TrayAccessibility* tray_accessibility_;  // not owned
-  internal::TrayDate* tray_date_;
+  TrayAccessibility* tray_accessibility_;  // not owned
+  TrayDate* tray_date_;
+
+  // A reference to the Screen share and capture item.
+  ScreenTrayItem* screen_capture_tray_item_;  // not owned
+  ScreenTrayItem* screen_share_tray_item_;  // not owned
 
   DISALLOW_COPY_AND_ASSIGN(SystemTray);
 };