| 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/display/shared_display_edge_indicator.h" | 5 #include "ash/display/shared_display_edge_indicator.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/coordinate_conversion.h" | 9 #include "ash/wm/coordinate_conversion.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 virtual ~IndicatorView() { | 29 virtual ~IndicatorView() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 void SetColor(SkColor color) { | 32 void SetColor(SkColor color) { |
| 33 color_ = color; | 33 color_ = color; |
| 34 SchedulePaint(); | 34 SchedulePaint(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // views::Views overrides: | 37 // views::Views overrides: |
| 38 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 38 virtual void OnPaint(gfx::Canvas* canvas) override { |
| 39 canvas->FillRect(gfx::Rect(bounds().size()), color_); | 39 canvas->FillRect(gfx::Rect(bounds().size()), color_); |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 SkColor color_; | 43 SkColor color_; |
| 44 DISALLOW_COPY_AND_ASSIGN(IndicatorView); | 44 DISALLOW_COPY_AND_ASSIGN(IndicatorView); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 views::Widget* CreateWidget(const gfx::Rect& bounds, | 47 views::Widget* CreateWidget(const gfx::Rect& bounds, |
| 48 views::View* contents_view) { | 48 views::View* contents_view) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 int value = animation->CurrentValueBetween(0, 255); | 105 int value = animation->CurrentValueBetween(0, 255); |
| 106 SkColor color = SkColorSetARGB(0xFF, value, value, value); | 106 SkColor color = SkColorSetARGB(0xFF, value, value, value); |
| 107 if (src_indicator_) | 107 if (src_indicator_) |
| 108 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); | 108 static_cast<IndicatorView*>(src_indicator_)->SetColor(color); |
| 109 if (dst_indicator_) | 109 if (dst_indicator_) |
| 110 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); | 110 static_cast<IndicatorView*>(dst_indicator_)->SetColor(color); |
| 111 | 111 |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace ash | 114 } // namespace ash |
| OLD | NEW |