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

Side by Side Diff: ui/views/controls/button/custom_button.cc

Issue 1901163002: Don't allow events to be swallowed by MdFocusRing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 30 matching lines...) Expand all
41 const int kFocusBorderOutset = -2; 41 const int kFocusBorderOutset = -2;
42 42
43 // The corner radius of the focus border roundrect. 43 // The corner radius of the focus border roundrect.
44 const int kFocusBorderCornerRadius = 3; 44 const int kFocusBorderCornerRadius = 3;
45 45
46 class MdFocusRing : public views::View { 46 class MdFocusRing : public views::View {
47 public: 47 public:
48 MdFocusRing() { 48 MdFocusRing() {
49 SetPaintToLayer(true); 49 SetPaintToLayer(true);
50 layer()->SetFillsBoundsOpaquely(false); 50 layer()->SetFillsBoundsOpaquely(false);
51
52 // Don't accept input events.
53 SetEnabled(false);
51 } 54 }
52 ~MdFocusRing() override {} 55 ~MdFocusRing() override {}
53 56
54 void OnPaint(gfx::Canvas* canvas) override { 57 void OnPaint(gfx::Canvas* canvas) override {
55 CustomButton::PaintMdFocusRing(canvas, this); 58 CustomButton::PaintMdFocusRing(canvas, this);
56 } 59 }
57 60
58 private: 61 private:
59 DISALLOW_COPY_AND_ASSIGN(MdFocusRing); 62 DISALLOW_COPY_AND_ASSIGN(MdFocusRing);
60 }; 63 };
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 Button::NotifyClick(event); 507 Button::NotifyClick(event);
505 } 508 }
506 509
507 void CustomButton::OnClickCanceled(const ui::Event& event) { 510 void CustomButton::OnClickCanceled(const ui::Event& event) {
508 if (ink_drop_delegate()) 511 if (ink_drop_delegate())
509 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); 512 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN);
510 Button::OnClickCanceled(event); 513 Button::OnClickCanceled(event);
511 } 514 }
512 515
513 } // namespace views 516 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698