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

Unified Diff: ash/system/user/button_from_view.h

Issue 210903003: Implemented system tray UI for new account management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge conflicts resolved. Created 6 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 | « ash/system/user/accounts_detailed_view.cc ('k') | ash/system/user/button_from_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/button_from_view.h
diff --git a/ash/system/user/button_from_view.h b/ash/system/user/button_from_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d391a6ddd50360b30020217c14917d674e7187d
--- /dev/null
+++ b/ash/system/user/button_from_view.h
@@ -0,0 +1,55 @@
+// Copyright 2014 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_USER_BUTTON_FROM_VIEW_H_
+#define ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_
+
+#include "base/macros.h"
+
+#include "ui/views/controls/button/custom_button.h"
+
+namespace ash {
+namespace tray {
+
+// This view is used to wrap it's content and transform it into button.
+class ButtonFromView : public views::CustomButton {
+ public:
+ ButtonFromView(views::View* content,
+ views::ButtonListener* listener,
+ bool highlight_on_hover);
+ virtual ~ButtonFromView();
+
+ // Called when the border should remain even in the non highlighted state.
+ void ForceBorderVisible(bool show);
+
+ // Overridden from views::View
+ virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
+
+ // Check if the item is hovered.
+ bool is_hovered_for_test() { return button_hovered_; }
+
+ private:
+ // Change the hover/active state of the "button" when the status changes.
+ void ShowActive();
+
+ // Content of button.
+ views::View* content_;
+
+ // Whether button should be highligthed on hover.
+ bool highlight_on_hover_;
+
+ // True if button is hovered.
+ bool button_hovered_;
+
+ // True if the border should be always visible.
+ bool show_border_;
+
+ DISALLOW_COPY_AND_ASSIGN(ButtonFromView);
+};
+
+} // namespace tray
+} // namespace ash
+
+#endif // ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_
« no previous file with comments | « ash/system/user/accounts_detailed_view.cc ('k') | ash/system/user/button_from_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698