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 "ui/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_view_state.h" |
8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/base/models/simple_menu_model.h" | 9 #include "ui/base/models/simple_menu_model.h" |
10 #include "ui/base/ui_base_switches_util.h" | 10 #include "ui/base/ui_base_switches_util.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // static | 121 // static |
122 gfx::Insets MessageView::GetShadowInsets() { | 122 gfx::Insets MessageView::GetShadowInsets() { |
123 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, | 123 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, |
124 kShadowBlur / 2, | 124 kShadowBlur / 2, |
125 kShadowBlur / 2 + kShadowOffset, | 125 kShadowBlur / 2 + kShadowOffset, |
126 kShadowBlur / 2); | 126 kShadowBlur / 2); |
127 } | 127 } |
128 | 128 |
129 void MessageView::CreateShadowBorder() { | 129 void MessageView::CreateShadowBorder() { |
130 SetBorder(scoped_ptr<views::Border>(new views::ShadowBorder( | 130 SetBorder(scoped_ptr<views::Border>(new views::ShadowBorder( |
131 gfx::ShadowValue(gfx::Point(0, kShadowOffset), kShadowBlur, | 131 gfx::ShadowValue(gfx::Vector2d(0, kShadowOffset), kShadowBlur, |
132 message_center::kShadowColor)))); | 132 message_center::kShadowColor)))); |
133 } | 133 } |
134 | 134 |
135 bool MessageView::IsCloseButtonFocused() { | 135 bool MessageView::IsCloseButtonFocused() { |
136 views::FocusManager* focus_manager = GetFocusManager(); | 136 views::FocusManager* focus_manager = GetFocusManager(); |
137 return focus_manager && focus_manager->GetFocusedView() == close_button(); | 137 return focus_manager && focus_manager->GetFocusedView() == close_button(); |
138 } | 138 } |
139 | 139 |
140 void MessageView::RequestFocusOnCloseButton() { | 140 void MessageView::RequestFocusOnCloseButton() { |
141 close_button_->RequestFocus(); | 141 close_button_->RequestFocus(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 void MessageView::SetDrawBackgroundAsActive(bool active) { | 271 void MessageView::SetDrawBackgroundAsActive(bool active) { |
272 if (!switches::IsTouchFeedbackEnabled()) | 272 if (!switches::IsTouchFeedbackEnabled()) |
273 return; | 273 return; |
274 background_view_->background()-> | 274 background_view_->background()-> |
275 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : | 275 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : |
276 kNotificationBackgroundColor); | 276 kNotificationBackgroundColor); |
277 SchedulePaint(); | 277 SchedulePaint(); |
278 } | 278 } |
279 | 279 |
280 } // namespace message_center | 280 } // namespace message_center |
OLD | NEW |