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/views/app_list_background.h" | 5 #include "ui/app_list/views/app_list_background.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "third_party/skia/include/core/SkPaint.h" | 9 #include "third_party/skia/include/core/SkPaint.h" |
10 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 SkPath path; | 48 SkPath path; |
49 // Contents corner radius is 1px smaller than border corner radius. | 49 // Contents corner radius is 1px smaller than border corner radius. |
50 SkScalar radius = SkIntToScalar(corner_radius_ - 1); | 50 SkScalar radius = SkIntToScalar(corner_radius_ - 1); |
51 path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius); | 51 path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius); |
52 canvas->ClipPath(path); | 52 canvas->ClipPath(path); |
53 | 53 |
54 SkPaint paint; | 54 SkPaint paint; |
55 paint.setStyle(SkPaint::kFill_Style); | 55 paint.setStyle(SkPaint::kFill_Style); |
56 | 56 |
57 int contents_top = bounds.y(); | 57 int contents_top = bounds.y(); |
58 if (main_view_->visible()) { | 58 views::View* search_box_view = main_view_->search_box_view(); |
59 views::View* search_box_view = main_view_->search_box_view(); | 59 if (main_view_->visible() && search_box_view->visible()) { |
60 const gfx::Rect search_box_view_bounds = | 60 const gfx::Rect search_box_view_bounds = |
61 search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds()); | 61 search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds()); |
62 gfx::Rect search_box_rect(bounds.x(), | 62 gfx::Rect search_box_rect(bounds.x(), |
63 bounds.y(), | 63 bounds.y(), |
64 bounds.width(), | 64 bounds.width(), |
65 search_box_view_bounds.bottom() - bounds.y()); | 65 search_box_view_bounds.bottom() - bounds.y()); |
66 | 66 |
67 paint.setColor(kSearchBoxBackground); | 67 paint.setColor(kSearchBoxBackground); |
68 canvas->DrawRect(search_box_rect, paint); | 68 canvas->DrawRect(search_box_rect, paint); |
69 | 69 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 GetImageSkiaNamed(IDR_APP_LIST_EXPERIMENTAL_ICON); | 107 GetImageSkiaNamed(IDR_APP_LIST_EXPERIMENTAL_ICON); |
108 canvas->DrawImageInt(experimental_icon, | 108 canvas->DrawImageInt(experimental_icon, |
109 contents_rect.right() - experimental_icon.width(), | 109 contents_rect.right() - experimental_icon.width(), |
110 contents_rect.bottom() - experimental_icon.height()); | 110 contents_rect.bottom() - experimental_icon.height()); |
111 } | 111 } |
112 | 112 |
113 canvas->Restore(); | 113 canvas->Restore(); |
114 } | 114 } |
115 | 115 |
116 } // namespace app_list | 116 } // namespace app_list |
OLD | NEW |