| 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/app_list/app_list_bubble_border.h" | 5 #include "ui/app_list/app_list_bubble_border.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkPath.h" | 7 #include "third_party/skia/include/core/SkPath.h" |
| 8 #include "third_party/skia/include/core/SkPaint.h" | 8 #include "third_party/skia/include/core/SkPaint.h" |
| 9 #include "third_party/skia/include/effects/SkGradientShader.h" | 9 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 : views::BubbleBorder2(views::BubbleBorder::BOTTOM_RIGHT), | 29 : views::BubbleBorder2(views::BubbleBorder::BOTTOM_RIGHT), |
| 30 app_list_view_(app_list_view), | 30 app_list_view_(app_list_view), |
| 31 search_box_view_(search_box_view) { | 31 search_box_view_(search_box_view) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 AppListBubbleBorder::~AppListBubbleBorder() { | 34 AppListBubbleBorder::~AppListBubbleBorder() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 void AppListBubbleBorder::PaintBackground(gfx::Canvas* canvas, | 37 void AppListBubbleBorder::PaintBackground(gfx::Canvas* canvas, |
| 38 const gfx::Rect& bounds) const { | 38 const gfx::Rect& bounds) const { |
| 39 SkPaint paint; |
| 40 paint.setStyle(SkPaint::kFill_Style); |
| 41 |
| 42 // TODO(benwells): Get these details painting on Windows. |
| 43 #if !defined(OS_WIN) |
| 39 const gfx::Rect search_box_view_bounds = | 44 const gfx::Rect search_box_view_bounds = |
| 40 app_list_view_->ConvertRectToWidget(search_box_view_->bounds()); | 45 app_list_view_->ConvertRectToWidget(search_box_view_->bounds()); |
| 41 gfx::Rect search_box_rect(bounds.x(), | 46 gfx::Rect search_box_rect(bounds.x(), |
| 42 bounds.y(), | 47 bounds.y(), |
| 43 bounds.width(), | 48 bounds.width(), |
| 44 search_box_view_bounds.bottom() - bounds.y()); | 49 search_box_view_bounds.bottom() - bounds.y()); |
| 45 | 50 |
| 46 SkPaint paint; | |
| 47 paint.setStyle(SkPaint::kFill_Style); | |
| 48 paint.setColor(kSearchBoxBackground); | 51 paint.setColor(kSearchBoxBackground); |
| 49 canvas->DrawRect(search_box_rect, paint); | 52 canvas->DrawRect(search_box_rect, paint); |
| 50 | 53 |
| 51 gfx::Rect seperator_rect(search_box_rect); | 54 gfx::Rect seperator_rect(search_box_rect); |
| 52 seperator_rect.set_y(seperator_rect.bottom()); | 55 seperator_rect.set_y(seperator_rect.bottom()); |
| 53 seperator_rect.set_height(kTopSeparatorSize); | 56 seperator_rect.set_height(kTopSeparatorSize); |
| 54 canvas->FillRect(seperator_rect, kTopSeparatorColor); | 57 canvas->FillRect(seperator_rect, kTopSeparatorColor); |
| 55 | 58 |
| 56 gfx::Rect contents_rect(bounds.x(), | 59 gfx::Rect contents_rect(bounds.x(), |
| 57 seperator_rect.bottom(), | 60 seperator_rect.bottom(), |
| 58 bounds.width(), | 61 bounds.width(), |
| 59 bounds.bottom() - seperator_rect.bottom()); | 62 bounds.bottom() - seperator_rect.bottom()); |
| 63 #else |
| 64 gfx::Rect contents_rect(bounds); |
| 65 #endif |
| 60 | 66 |
| 61 paint.setColor(kContentsBackgroundColor); | 67 paint.setColor(kContentsBackgroundColor); |
| 62 canvas->DrawRect(contents_rect, paint); | 68 canvas->DrawRect(contents_rect, paint); |
| 63 } | 69 } |
| 64 | 70 |
| 65 } // namespace app_list | 71 } // namespace app_list |
| OLD | NEW |