| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 paint.setColor(kContentsBackgroundColor); | 82 paint.setColor(kContentsBackgroundColor); |
| 83 canvas->DrawRect(contents_rect, paint); | 83 canvas->DrawRect(contents_rect, paint); |
| 84 | 84 |
| 85 if (app_list::switches::IsExperimentalAppListEnabled()) { | 85 if (app_list::switches::IsExperimentalAppListEnabled()) { |
| 86 if (main_view_->visible()) { | 86 if (main_view_->visible()) { |
| 87 views::View* contents_view = main_view_->contents_view(); | 87 views::View* contents_view = main_view_->contents_view(); |
| 88 const gfx::Rect contents_view_view_bounds = | 88 const gfx::Rect contents_view_view_bounds = |
| 89 contents_view->ConvertRectToWidget(contents_view->GetLocalBounds()); | 89 contents_view->ConvertRectToWidget(contents_view->GetLocalBounds()); |
| 90 gfx::Rect separator_rect(contents_rect); | 90 gfx::Rect separator_rect(contents_rect); |
| 91 // Extra kContentsSwitcherSeparatorHeight pixels so the launcher page | 91 separator_rect.set_y(contents_view_view_bounds.bottom()); |
| 92 // indicator overlays the separator rect. | |
| 93 separator_rect.set_y(contents_view_view_bounds.bottom() + | |
| 94 kContentsSwitcherSeparatorHeight); | |
| 95 separator_rect.set_height(kBottomSeparatorSize); | 92 separator_rect.set_height(kBottomSeparatorSize); |
| 96 canvas->FillRect(separator_rect, kBottomSeparatorColor); | 93 canvas->FillRect(separator_rect, kBottomSeparatorColor); |
| 97 int contents_switcher_top = separator_rect.bottom(); | 94 int contents_switcher_top = separator_rect.bottom(); |
| 98 gfx::Rect contents_switcher_rect(bounds.x(), | 95 gfx::Rect contents_switcher_rect(bounds.x(), |
| 99 contents_switcher_top, | 96 contents_switcher_top, |
| 100 bounds.width(), | 97 bounds.width(), |
| 101 bounds.bottom() - contents_switcher_top); | 98 bounds.bottom() - contents_switcher_top); |
| 102 paint.setColor(kContentsSwitcherBackgroundColor); | 99 paint.setColor(kContentsSwitcherBackgroundColor); |
| 103 canvas->DrawRect(contents_switcher_rect, paint); | 100 canvas->DrawRect(contents_switcher_rect, paint); |
| 104 } | 101 } |
| 105 | 102 |
| 106 // Draw a banner in the corner of the app list if it is the experimental app | 103 // Draw a banner in the corner of the app list if it is the experimental app |
| 107 // list. | 104 // list. |
| 108 const gfx::ImageSkia& experimental_icon = | 105 const gfx::ImageSkia& experimental_icon = |
| 109 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 106 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 110 IDR_APP_LIST_EXPERIMENTAL_ICON); | 107 IDR_APP_LIST_EXPERIMENTAL_ICON); |
| 111 canvas->DrawImageInt(experimental_icon, | 108 canvas->DrawImageInt(experimental_icon, |
| 112 contents_rect.right() - experimental_icon.width(), | 109 contents_rect.right() - experimental_icon.width(), |
| 113 contents_rect.bottom() - experimental_icon.height()); | 110 contents_rect.bottom() - experimental_icon.height()); |
| 114 } | 111 } |
| 115 | 112 |
| 116 canvas->Restore(); | 113 canvas->Restore(); |
| 117 } | 114 } |
| 118 | 115 |
| 119 } // namespace app_list | 116 } // namespace app_list |
| OLD | NEW |