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

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 82113004: Fix key navigation to cut/copy/paste zoom button on wrench menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 4a15975d5b836c3816a20cf8688530db10390ce7..3259f9df375b2903db9211a019a455d8c32f660b 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -9,6 +9,13 @@
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/screen.h"
+#include "ui/views/controls/button/blue_button.h"
+#include "ui/views/controls/button/checkbox.h"
+#include "ui/views/controls/button/image_button.h"
+#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/menu_button.h"
+#include "ui/views/controls/button/radio_button.h"
+#include "ui/views/controls/button/text_button.h"
#include "ui/views/widget/widget.h"
namespace views {
@@ -22,6 +29,27 @@ const char CustomButton::kViewClassName[] = "CustomButton";
////////////////////////////////////////////////////////////////////////////////
// CustomButton, public:
+// static
+const CustomButton* CustomButton::AsCustomButton(const views::View* view) {
+ return AsCustomButton(const_cast<views::View*>(view));
+}
+
+CustomButton* CustomButton::AsCustomButton(views::View* view) {
+ if (view) {
+ const char* classname = view->GetClassName();
+ if (!strcmp(classname, Checkbox::kViewClassName) ||
+ !strcmp(classname, CustomButton::kViewClassName) ||
+ !strcmp(classname, ImageButton::kViewClassName) ||
+ !strcmp(classname, LabelButton::kViewClassName) ||
+ !strcmp(classname, RadioButton::kViewClassName) ||
+ !strcmp(classname, MenuButton::kViewClassName) ||
+ !strcmp(classname, TextButton::kViewClassName)) {
+ return static_cast<CustomButton*>(view);
+ }
+ }
+ return NULL;
+}
+
CustomButton::~CustomButton() {
}
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698