| 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/notification_view.h" | 5 #include "ui/message_center/views/notification_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "ui/views/controls/label.h" | 43 #include "ui/views/controls/label.h" |
| 44 #include "ui/views/controls/progress_bar.h" | 44 #include "ui/views/controls/progress_bar.h" |
| 45 #include "ui/views/layout/box_layout.h" | 45 #include "ui/views/layout/box_layout.h" |
| 46 #include "ui/views/layout/fill_layout.h" | 46 #include "ui/views/layout/fill_layout.h" |
| 47 #include "ui/views/native_cursor.h" | 47 #include "ui/views/native_cursor.h" |
| 48 #include "ui/views/painter.h" | 48 #include "ui/views/painter.h" |
| 49 #include "ui/views/view_targeter.h" | 49 #include "ui/views/view_targeter.h" |
| 50 #include "ui/views/widget/widget.h" | 50 #include "ui/views/widget/widget.h" |
| 51 #include "url/gurl.h" | 51 #include "url/gurl.h" |
| 52 | 52 |
| 53 #if defined(OS_WIN) |
| 54 #include "ui/base/win/shell.h" |
| 55 #endif |
| 56 |
| 53 namespace { | 57 namespace { |
| 54 | 58 |
| 55 // Dimensions. | 59 // Dimensions. |
| 56 const int kProgressBarBottomPadding = 0; | 60 const int kProgressBarBottomPadding = 0; |
| 57 | 61 |
| 58 // static | 62 // static |
| 59 scoped_ptr<views::Border> MakeEmptyBorder(int top, | 63 scoped_ptr<views::Border> MakeEmptyBorder(int top, |
| 60 int left, | 64 int left, |
| 61 int bottom, | 65 int bottom, |
| 62 int right) { | 66 int right) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // Currently all roads lead to the generic NotificationView. | 195 // Currently all roads lead to the generic NotificationView. |
| 192 NotificationView* notification_view = | 196 NotificationView* notification_view = |
| 193 new NotificationView(controller, notification); | 197 new NotificationView(controller, notification); |
| 194 | 198 |
| 195 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 199 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 196 // Don't create shadows for notification toasts on linux wih aura. | 200 // Don't create shadows for notification toasts on linux wih aura. |
| 197 if (top_level) | 201 if (top_level) |
| 198 return notification_view; | 202 return notification_view; |
| 199 #endif | 203 #endif |
| 200 | 204 |
| 205 #if defined(OS_WIN) |
| 206 // Don't create shadows for notifications on Windows under classic theme. |
| 207 if (top_level && !ui::win::IsAeroGlassEnabled()) { |
| 208 return notification_view; |
| 209 } |
| 210 #endif // OS_WIN |
| 211 |
| 201 notification_view->CreateShadowBorder(); | 212 notification_view->CreateShadowBorder(); |
| 202 return notification_view; | 213 return notification_view; |
| 203 } | 214 } |
| 204 | 215 |
| 205 views::View* NotificationView::TargetForRect(views::View* root, | 216 views::View* NotificationView::TargetForRect(views::View* root, |
| 206 const gfx::Rect& rect) { | 217 const gfx::Rect& rect) { |
| 207 CHECK_EQ(root, this); | 218 CHECK_EQ(root, this); |
| 208 | 219 |
| 209 // TODO(tdanderson): Modify this function to support rect-based event | 220 // TODO(tdanderson): Modify this function to support rect-based event |
| 210 // targeting. Using the center point of |rect| preserves this function's | 221 // targeting. Using the center point of |rect| preserves this function's |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 | 807 |
| 797 return message_line_limit; | 808 return message_line_limit; |
| 798 } | 809 } |
| 799 | 810 |
| 800 int NotificationView::GetMessageHeight(int width, int limit) const { | 811 int NotificationView::GetMessageHeight(int width, int limit) const { |
| 801 return message_view_ ? | 812 return message_view_ ? |
| 802 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 813 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 803 } | 814 } |
| 804 | 815 |
| 805 } // namespace message_center | 816 } // namespace message_center |
| OLD | NEW |