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

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

Issue 2095663004: Revert of mash: Convert TrayBackgroundView to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/system_tray_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray_bubble.h
diff --git a/ash/system/tray/system_tray_bubble.h b/ash/system/tray/system_tray_bubble.h
new file mode 100644
index 0000000000000000000000000000000000000000..31bb500252b40783edea2d8d00a3ad3eafbc76b0
--- /dev/null
+++ b/ash/system/tray/system_tray_bubble.h
@@ -0,0 +1,78 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
+#define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
+
+#include <memory>
+#include <vector>
+
+#include "ash/system/user/login_status.h"
+#include "base/macros.h"
+#include "base/timer/timer.h"
+#include "ui/views/bubble/tray_bubble_view.h"
+
+namespace ash {
+class SystemTray;
+class SystemTrayItem;
+
+class SystemTrayBubble {
+ public:
+ enum BubbleType {
+ BUBBLE_TYPE_DEFAULT,
+ BUBBLE_TYPE_DETAILED,
+ BUBBLE_TYPE_NOTIFICATION
+ };
+
+ SystemTrayBubble(ash::SystemTray* tray,
+ const std::vector<ash::SystemTrayItem*>& items,
+ BubbleType bubble_type);
+ virtual ~SystemTrayBubble();
+
+ // Change the items displayed in the bubble.
+ void UpdateView(const std::vector<ash::SystemTrayItem*>& items,
+ BubbleType bubble_type);
+
+ // Creates |bubble_view_| and a child views for each member of |items_|.
+ // Also creates |bubble_wrapper_|. |init_params| may be modified.
+ void InitView(views::View* anchor,
+ LoginStatus login_status,
+ views::TrayBubbleView::InitParams* init_params);
+
+ // Focus the default item if no item is focused. Othewise, do nothing.
+ void FocusDefaultIfNeeded();
+
+ BubbleType bubble_type() const { return bubble_type_; }
+ views::TrayBubbleView* bubble_view() const { return bubble_view_; }
+
+ void DestroyItemViews();
+ void BubbleViewDestroyed();
+ void StartAutoCloseTimer(int seconds);
+ void StopAutoCloseTimer();
+ void RestartAutoCloseTimer();
+ void Close();
+ void SetVisible(bool is_visible);
+ bool IsVisible();
+
+ // Returns true if any of the SystemTrayItems return true from
+ // ShouldShowShelf().
+ bool ShouldShowShelf() const;
+
+ private:
+ void CreateItemViews(LoginStatus login_status);
+
+ ash::SystemTray* tray_;
+ views::TrayBubbleView* bubble_view_;
+ std::vector<ash::SystemTrayItem*> items_;
+ BubbleType bubble_type_;
+
+ int autoclose_delay_;
+ base::OneShotTimer autoclose_;
+
+ DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble);
+};
+
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/system_tray_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698