OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |