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

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

Issue 900163002: Make ShadowBorder use ShadowValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_animations
Patch Set: Created 5 years, 10 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 | « ui/app_list/views/speech_view.cc ('k') | ui/views/shadow_border.h » ('j') | 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 "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"
11 #include "ui/compositor/scoped_layer_animation_settings.h" 11 #include "ui/compositor/scoped_layer_animation_settings.h"
12 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
13 #include "ui/gfx/image/image_skia_operations.h" 13 #include "ui/gfx/image/image_skia_operations.h"
14 #include "ui/gfx/shadow_value.h"
14 #include "ui/message_center/message_center.h" 15 #include "ui/message_center/message_center.h"
15 #include "ui/message_center/message_center_style.h" 16 #include "ui/message_center/message_center_style.h"
16 #include "ui/message_center/views/padded_button.h" 17 #include "ui/message_center/views/padded_button.h"
17 #include "ui/resources/grit/ui_resources.h" 18 #include "ui/resources/grit/ui_resources.h"
18 #include "ui/strings/grit/ui_strings.h" 19 #include "ui/strings/grit/ui_strings.h"
19 #include "ui/views/background.h" 20 #include "ui/views/background.h"
20 #include "ui/views/controls/button/image_button.h" 21 #include "ui/views/controls/button/image_button.h"
21 #include "ui/views/controls/image_view.h" 22 #include "ui/views/controls/image_view.h"
22 #include "ui/views/controls/scroll_view.h" 23 #include "ui/views/controls/scroll_view.h"
23 #include "ui/views/focus/focus_manager.h" 24 #include "ui/views/focus/focus_manager.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 120
120 // static 121 // static
121 gfx::Insets MessageView::GetShadowInsets() { 122 gfx::Insets MessageView::GetShadowInsets() {
122 return gfx::Insets(kShadowBlur / 2 - kShadowOffset, 123 return gfx::Insets(kShadowBlur / 2 - kShadowOffset,
123 kShadowBlur / 2, 124 kShadowBlur / 2,
124 kShadowBlur / 2 + kShadowOffset, 125 kShadowBlur / 2 + kShadowOffset,
125 kShadowBlur / 2); 126 kShadowBlur / 2);
126 } 127 }
127 128
128 void MessageView::CreateShadowBorder() { 129 void MessageView::CreateShadowBorder() {
129 SetBorder(scoped_ptr<views::Border>( 130 SetBorder(scoped_ptr<views::Border>(new views::ShadowBorder(
130 new views::ShadowBorder(kShadowBlur, 131 gfx::ShadowValue(gfx::Point(0, kShadowOffset), kShadowBlur,
131 message_center::kShadowColor, 132 message_center::kShadowColor))));
132 kShadowOffset, // Vertical offset.
133 0))); // Horizontal offset.
134 } 133 }
135 134
136 bool MessageView::IsCloseButtonFocused() { 135 bool MessageView::IsCloseButtonFocused() {
137 views::FocusManager* focus_manager = GetFocusManager(); 136 views::FocusManager* focus_manager = GetFocusManager();
138 return focus_manager && focus_manager->GetFocusedView() == close_button(); 137 return focus_manager && focus_manager->GetFocusedView() == close_button();
139 } 138 }
140 139
141 void MessageView::RequestFocusOnCloseButton() { 140 void MessageView::RequestFocusOnCloseButton() {
142 close_button_->RequestFocus(); 141 close_button_->RequestFocus();
143 } 142 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 void MessageView::SetDrawBackgroundAsActive(bool active) { 271 void MessageView::SetDrawBackgroundAsActive(bool active) {
273 if (!switches::IsTouchFeedbackEnabled()) 272 if (!switches::IsTouchFeedbackEnabled())
274 return; 273 return;
275 background_view_->background()-> 274 background_view_->background()->
276 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : 275 SetNativeControlColor(active ? kHoveredButtonBackgroundColor :
277 kNotificationBackgroundColor); 276 kNotificationBackgroundColor);
278 SchedulePaint(); 277 SchedulePaint();
279 } 278 }
280 279
281 } // namespace message_center 280 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/app_list/views/speech_view.cc ('k') | ui/views/shadow_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698