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

Unified Diff: ui/app_list/views/progress_bar_view.cc

Issue 645853013: Remove some platform specific stuff from views. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/views/progress_bar_view.h ('k') | ui/app_list/views/pulsing_block_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/progress_bar_view.cc
diff --git a/ui/app_list/views/progress_bar_view.cc b/ui/app_list/views/progress_bar_view.cc
deleted file mode 100644
index 5a7094bfe14e809e09400cb575b39289f3367a83..0000000000000000000000000000000000000000
--- a/ui/app_list/views/progress_bar_view.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2013 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/views/progress_bar_view.h"
-
-#include <algorithm>
-
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/image/image_skia.h"
-#include "ui/gfx/insets.h"
-#include "ui/resources/grit/ui_resources.h"
-#include "ui/views/painter.h"
-
-namespace app_list {
-
-namespace {
-
-// Image assets for the bar part.
-const int kProgressBarImages[] = {
- IDR_APP_LIST_ITEM_PROGRESS_LEFT,
- IDR_APP_LIST_ITEM_PROGRESS_CENTER,
- IDR_APP_LIST_ITEM_PROGRESS_RIGHT
-};
-
-} // namespace
-
-ProgressBarView::ProgressBarView()
- : background_painter_(views::Painter::CreateImagePainter(
- *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
- IDR_APP_LIST_ITEM_PROGRESS_BACKGROUND),
- gfx::Insets(2, 2, 2, 2))),
- bar_painter_(new views::HorizontalPainter(kProgressBarImages)) {}
-
-ProgressBarView::~ProgressBarView() {}
-
-gfx::Size ProgressBarView::GetPreferredSize() const {
- return background_painter_->GetMinimumSize();
-}
-
-void ProgressBarView::OnPaint(gfx::Canvas* canvas) {
- gfx::Size paint_size = size();
-
- const gfx::Size min_size(background_painter_->GetMinimumSize());
- if (paint_size.width() < min_size.width() ||
- paint_size.height() < min_size.height()) {
- return;
- }
-
- background_painter_->Paint(canvas, paint_size);
-
- const int kBarEndWidth = 4;
- const int bar_width = paint_size.width() - kBarEndWidth;
- DCHECK_GE(bar_width, 0);
-
- // Map normalized value in [0,1] to the pixel width in
- // [kBarEndWidth, view_size.width()].
- paint_size.set_width(kBarEndWidth + bar_width * GetNormalizedValue());
- bar_painter_->Paint(canvas, paint_size);
-}
-
-} // namespace app_list
« no previous file with comments | « ui/app_list/views/progress_bar_view.h ('k') | ui/app_list/views/pulsing_block_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698