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

Side by Side Diff: ui/message_center/views/message_view.cc

Issue 2892943002: Call the parent methods in MessageView::OnPaint, OnFocus, and OnBlur (Closed)
Patch Set: Created 3 years, 7 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/message_center/views/message_view.h" 5 #include "ui/message_center/views/message_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/models/simple_menu_model.h" 10 #include "ui/base/models/simple_menu_model.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // Space key handling is triggerred at key-release timing. See 144 // Space key handling is triggerred at key-release timing. See
145 // ui/views/controls/buttons/custom_button.cc for why. 145 // ui/views/controls/buttons/custom_button.cc for why.
146 if (event.flags() != ui::EF_NONE || event.key_code() != ui::VKEY_SPACE) 146 if (event.flags() != ui::EF_NONE || event.key_code() != ui::VKEY_SPACE)
147 return false; 147 return false;
148 148
149 controller_->ClickOnNotification(notification_id_); 149 controller_->ClickOnNotification(notification_id_);
150 return true; 150 return true;
151 } 151 }
152 152
153 void MessageView::OnPaint(gfx::Canvas* canvas) { 153 void MessageView::OnPaint(gfx::Canvas* canvas) {
154 views::View::OnPaint(canvas);
154 views::Painter::PaintFocusPainter(this, canvas, focus_painter_.get()); 155 views::Painter::PaintFocusPainter(this, canvas, focus_painter_.get());
155 } 156 }
156 157
157 void MessageView::OnFocus() { 158 void MessageView::OnFocus() {
159 views::View::OnFocus();
158 // We paint a focus indicator. 160 // We paint a focus indicator.
159 SchedulePaint(); 161 SchedulePaint();
160 } 162 }
161 163
162 void MessageView::OnBlur() { 164 void MessageView::OnBlur() {
165 views::View::OnBlur();
163 // We paint a focus indicator. 166 // We paint a focus indicator.
164 SchedulePaint(); 167 SchedulePaint();
165 } 168 }
166 169
167 void MessageView::Layout() { 170 void MessageView::Layout() {
168 gfx::Rect content_bounds = GetContentsBounds(); 171 gfx::Rect content_bounds = GetContentsBounds();
169 172
170 // Background. 173 // Background.
171 background_view_->SetBoundsRect(content_bounds); 174 background_view_->SetBoundsRect(content_bounds);
172 #if defined(OS_CHROMEOS) 175 #if defined(OS_CHROMEOS)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 226 }
224 227
225 void MessageView::SetDrawBackgroundAsActive(bool active) { 228 void MessageView::SetDrawBackgroundAsActive(bool active) {
226 background_view_->background()-> 229 background_view_->background()->
227 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : 230 SetNativeControlColor(active ? kHoveredButtonBackgroundColor :
228 kNotificationBackgroundColor); 231 kNotificationBackgroundColor);
229 SchedulePaint(); 232 SchedulePaint();
230 } 233 }
231 234
232 } // namespace message_center 235 } // namespace message_center
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