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

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

Issue 14225010: Sets request_focus_on_press to false for message_center_buttons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 "grit/ui_resources.h" 7 #include "grit/ui_resources.h"
8 #include "grit/ui_strings.h" 8 #include "grit/ui_strings.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 private: 71 private:
72 gfx::Insets padding_; 72 gfx::Insets padding_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(ControlButton); 74 DISALLOW_COPY_AND_ASSIGN(ControlButton);
75 }; 75 };
76 76
77 ControlButton::ControlButton(views::ButtonListener* listener) 77 ControlButton::ControlButton(views::ButtonListener* listener)
78 : views::ImageButton(listener) { 78 : views::ImageButton(listener) {
79 set_focusable(true); 79 set_focusable(true);
80 set_request_focus_on_press(false);
80 } 81 }
81 82
82 ControlButton::~ControlButton() { 83 ControlButton::~ControlButton() {
83 } 84 }
84 85
85 void ControlButton::SetPadding(int horizontal_padding, int vertical_padding) { 86 void ControlButton::SetPadding(int horizontal_padding, int vertical_padding) {
86 padding_.Set(std::max(vertical_padding, 0), 87 padding_.Set(std::max(vertical_padding, 0),
87 std::max(horizontal_padding, 0), 88 std::max(horizontal_padding, 0),
88 std::max(-vertical_padding, 0), 89 std::max(-vertical_padding, 0),
89 std::max(-horizontal_padding, 0)); 90 std::max(-horizontal_padding, 0));
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 gfx::Rect(screen_location, gfx::Size()), 378 gfx::Rect(screen_location, gfx::Size()),
378 views::MenuItemView::TOPRIGHT, 379 views::MenuItemView::TOPRIGHT,
379 views::MenuRunner::HAS_MNEMONICS)); 380 views::MenuRunner::HAS_MNEMONICS));
380 } 381 }
381 382
382 void MessageView::OnSlideOut() { 383 void MessageView::OnSlideOut() {
383 message_center_->RemoveNotification(notification_id_, true); // By user. 384 message_center_->RemoveNotification(notification_id_, true); // By user.
384 } 385 }
385 386
386 } // namespace message_center 387 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698