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

Unified Diff: ui/views/controls/button/multi_target_button.h

Issue 59383003: Add the button style for combobox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years, 1 month 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
Index: ui/views/controls/button/multi_target_button.h
diff --git a/ui/views/controls/button/multi_target_button.h b/ui/views/controls/button/multi_target_button.h
new file mode 100644
index 0000000000000000000000000000000000000000..bec15083c47944f2df9f0d2206e6cc9b5328160c
--- /dev/null
+++ b/ui/views/controls/button/multi_target_button.h
@@ -0,0 +1,52 @@
+// Copyright 2013 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 UI_VIEWS_CONTROLS_BUTTON_MULTI_TARGET_BUTTON_H_
+#define UI_VIEWS_CONTROLS_BUTTON_MULTI_TARGET_BUTTON_H_
+
+#include "ui/views/controls/button/button.h"
+#include "ui/views/controls/button/button_dropdown.h"
+#include "ui/views/controls/button/menu_button_listener.h"
+#include "ui/views/view.h"
+
+namespace ui {
+class MenuModel;
+}
+
+namespace views {
+
+class LabelButton;
+class MenuButton;
+class MenuDelegate;
+class MenuRunner;
+
+// A button with a drop down menu to select other options.
+class VIEWS_EXPORT MultiTargetButton : public views::View,
+ public views::ButtonListener,
+ public views::MenuButtonListener {
+ public:
+ explicit MultiTargetButton(ui::MenuModel* menu_model);
+
+ virtual ~MultiTargetButton();
+
+ // views::ButtonListener:
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+
+ // views::MenuButtonListener:
+ virtual void OnMenuButtonClicked(View* source, const gfx::Point& point)
+ OVERRIDE;
+
+ private:
+ ui::MenuModel* menu_model_;
+ LabelButton* button_;
+ MenuButton* drop_arrow_button_;
+
+ scoped_ptr<MenuRunner> menu_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(MultiTargetButton);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_CONTROLS_BUTTON_MULTI_TARGET_BUTTON_H_

Powered by Google App Engine
This is Rietveld 408576698