| 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 "ash/common/system/tray/tray_details_view.h" | 5 #include "ash/common/system/tray/tray_details_view.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_view_ids.h" | 7 #include "ash/common/ash_view_ids.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| 10 #include "ash/common/system/tray/system_menu_button.h" | 10 #include "ash/common/system/tray/system_menu_button.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 DrawShadow(context, | 209 DrawShadow(context, |
| 210 gfx::Rect(0, 0, view->width(), view->bounds().bottom())); | 210 gfx::Rect(0, 0, view->width(), view->bounds().bottom())); |
| 211 return true; | 211 return true; |
| 212 } | 212 } |
| 213 | 213 |
| 214 // Draws a drop shadow below |shadowed_area|. | 214 // Draws a drop shadow below |shadowed_area|. |
| 215 void DrawShadow(const ui::PaintContext& context, | 215 void DrawShadow(const ui::PaintContext& context, |
| 216 const gfx::Rect& shadowed_area) { | 216 const gfx::Rect& shadowed_area) { |
| 217 ui::PaintRecorder recorder(context, size()); | 217 ui::PaintRecorder recorder(context, size()); |
| 218 gfx::Canvas* canvas = recorder.canvas(); | 218 gfx::Canvas* canvas = recorder.canvas(); |
| 219 cc::PaintFlags paint; | 219 cc::PaintFlags flags; |
| 220 gfx::ShadowValues shadow; | 220 gfx::ShadowValues shadow; |
| 221 shadow.emplace_back(gfx::Vector2d(0, kShadowOffsetY), kShadowBlur, | 221 shadow.emplace_back(gfx::Vector2d(0, kShadowOffsetY), kShadowBlur, |
| 222 kSeparatorColor); | 222 kSeparatorColor); |
| 223 paint.setLooper(gfx::CreateShadowDrawLooperCorrectBlur(shadow)); | 223 flags.setLooper(gfx::CreateShadowDrawLooperCorrectBlur(shadow)); |
| 224 paint.setAntiAlias(true); | 224 flags.setAntiAlias(true); |
| 225 canvas->ClipRect(shadowed_area, SkClipOp::kDifference); | 225 canvas->ClipRect(shadowed_area, SkClipOp::kDifference); |
| 226 canvas->DrawRect(shadowed_area, paint); | 226 canvas->DrawRect(shadowed_area, flags); |
| 227 } | 227 } |
| 228 | 228 |
| 229 views::BoxLayout* box_layout_; | 229 views::BoxLayout* box_layout_; |
| 230 | 230 |
| 231 // Header child views that stick to the top of visible viewport when scrolled. | 231 // Header child views that stick to the top of visible viewport when scrolled. |
| 232 std::vector<Header> headers_; | 232 std::vector<Header> headers_; |
| 233 | 233 |
| 234 DISALLOW_COPY_AND_ASSIGN(ScrollContentsView); | 234 DISALLOW_COPY_AND_ASSIGN(ScrollContentsView); |
| 235 }; | 235 }; |
| 236 | 236 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 if (index < child_count() - 1 && child_at(index + 1) != title_row_) | 543 if (index < child_count() - 1 && child_at(index + 1) != title_row_) |
| 544 scroll_border_->set_visible(true); | 544 scroll_border_->set_visible(true); |
| 545 else | 545 else |
| 546 scroll_border_->set_visible(false); | 546 scroll_border_->set_visible(false); |
| 547 } | 547 } |
| 548 | 548 |
| 549 views::View::OnPaintBorder(canvas); | 549 views::View::OnPaintBorder(canvas); |
| 550 } | 550 } |
| 551 | 551 |
| 552 } // namespace ash | 552 } // namespace ash |
| OLD | NEW |