summaryrefslogtreecommitdiff
path: root/chromium/ash/system/tray/fixed_sized_image_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ash/system/tray/fixed_sized_image_view.cc')
-rw-r--r--chromium/ash/system/tray/fixed_sized_image_view.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/chromium/ash/system/tray/fixed_sized_image_view.cc b/chromium/ash/system/tray/fixed_sized_image_view.cc
new file mode 100644
index 00000000000..d0d49b92f21
--- /dev/null
+++ b/chromium/ash/system/tray/fixed_sized_image_view.cc
@@ -0,0 +1,27 @@
+// 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 "ash/system/tray/fixed_sized_image_view.h"
+
+namespace ash {
+namespace internal {
+
+FixedSizedImageView::FixedSizedImageView(int width, int height)
+ : width_(width),
+ height_(height) {
+ SetHorizontalAlignment(views::ImageView::CENTER);
+ SetVerticalAlignment(views::ImageView::CENTER);
+}
+
+FixedSizedImageView::~FixedSizedImageView() {
+}
+
+gfx::Size FixedSizedImageView::GetPreferredSize() {
+ gfx::Size size = views::ImageView::GetPreferredSize();
+ return gfx::Size(width_ ? width_ : size.width(),
+ height_ ? height_ : size.height());
+}
+
+} // namespace internal
+} // namespace ash