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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 private: | 72 private: |
73 gfx::Insets padding_; | 73 gfx::Insets padding_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(ControlButton); | 75 DISALLOW_COPY_AND_ASSIGN(ControlButton); |
76 }; | 76 }; |
77 | 77 |
78 ControlButton::ControlButton(views::ButtonListener* listener) | 78 ControlButton::ControlButton(views::ButtonListener* listener) |
79 : views::ImageButton(listener) { | 79 : views::ImageButton(listener) { |
80 set_focusable(true); | 80 set_focusable(true); |
| 81 set_request_focus_on_press(false); |
81 } | 82 } |
82 | 83 |
83 ControlButton::~ControlButton() { | 84 ControlButton::~ControlButton() { |
84 } | 85 } |
85 | 86 |
86 void ControlButton::SetPadding(int horizontal_padding, int vertical_padding) { | 87 void ControlButton::SetPadding(int horizontal_padding, int vertical_padding) { |
87 padding_.Set(std::max(vertical_padding, 0), | 88 padding_.Set(std::max(vertical_padding, 0), |
88 std::max(horizontal_padding, 0), | 89 std::max(horizontal_padding, 0), |
89 std::max(-vertical_padding, 0), | 90 std::max(-vertical_padding, 0), |
90 std::max(-horizontal_padding, 0)); | 91 std::max(-horizontal_padding, 0)); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 gfx::Rect(screen_location, gfx::Size()), | 383 gfx::Rect(screen_location, gfx::Size()), |
383 views::MenuItemView::TOPRIGHT, | 384 views::MenuItemView::TOPRIGHT, |
384 views::MenuRunner::HAS_MNEMONICS)); | 385 views::MenuRunner::HAS_MNEMONICS)); |
385 } | 386 } |
386 | 387 |
387 void MessageView::OnSlideOut() { | 388 void MessageView::OnSlideOut() { |
388 message_center_->RemoveNotification(notification_id_, true); // By user. | 389 message_center_->RemoveNotification(notification_id_, true); // By user. |
389 } | 390 } |
390 | 391 |
391 } // namespace message_center | 392 } // namespace message_center |
OLD | NEW |