Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: ui/app_list/app_list_background.cc

Issue 11784034: Skeleton for app_list on OSX, and refactoring for enable_app_list=1 on OS=="mac". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase for 175876 and 175961 Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_background.h ('k') | ui/app_list/app_list_item_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_background.cc
diff --git a/ui/app_list/app_list_background.cc b/ui/app_list/app_list_background.cc
deleted file mode 100644
index 8eddf71e9dc791d38f8456accb3c005dda25e495..0000000000000000000000000000000000000000
--- a/ui/app_list/app_list_background.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/app_list/app_list_background.h"
-
-#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkPath.h"
-#include "ui/app_list/app_list_constants.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/rect.h"
-#include "ui/gfx/skia_util.h"
-#include "ui/views/view.h"
-
-namespace {
-
-const SkColor kSearchBoxBackground = SK_ColorWHITE;
-
-// Colors and sizes of top separator between searchbox and grid view.
-const SkColor kTopSeparatorColor = SkColorSetRGB(0xE5, 0xE5, 0xE5);
-const int kTopSeparatorSize = 1;
-
-} // namespace
-
-namespace app_list {
-
-AppListBackground::AppListBackground(int corner_radius,
- views::View* search_box_view)
- : corner_radius_(corner_radius),
- search_box_view_(search_box_view) {
-}
-
-AppListBackground::~AppListBackground() {
-}
-
-void AppListBackground::Paint(gfx::Canvas* canvas,
- views::View* view) const {
- gfx::Rect bounds = view->GetContentsBounds();
-
- canvas->Save();
- SkPath path;
- // Contents corner radius is 1px smaller than border corner radius.
- SkScalar radius = SkIntToScalar(corner_radius_ - 1);
- path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius);
- canvas->ClipPath(path);
-
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
-
- const gfx::Rect search_box_view_bounds =
- search_box_view_->ConvertRectToWidget(search_box_view_->GetLocalBounds());
- gfx::Rect search_box_rect(bounds.x(),
- bounds.y(),
- bounds.width(),
- search_box_view_bounds.bottom() - bounds.y());
-
- paint.setColor(kSearchBoxBackground);
- canvas->DrawRect(search_box_rect, paint);
-
- gfx::Rect seperator_rect(search_box_rect);
- seperator_rect.set_y(seperator_rect.bottom());
- seperator_rect.set_height(kTopSeparatorSize);
- canvas->FillRect(seperator_rect, kTopSeparatorColor);
-
- gfx::Rect contents_rect(bounds.x(),
- seperator_rect.bottom(),
- bounds.width(),
- bounds.bottom() - seperator_rect.bottom());
-
- paint.setColor(kContentsBackgroundColor);
- canvas->DrawRect(contents_rect, paint);
- canvas->Restore();
-}
-
-} // namespace app_list
« no previous file with comments | « ui/app_list/app_list_background.h ('k') | ui/app_list/app_list_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698