summaryrefslogtreecommitdiff
path: root/chromium/ash/system/tray/fixed_sized_image_view.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ash/system/tray/fixed_sized_image_view.h')
-rw-r--r--chromium/ash/system/tray/fixed_sized_image_view.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/chromium/ash/system/tray/fixed_sized_image_view.h b/chromium/ash/system/tray/fixed_sized_image_view.h
new file mode 100644
index 00000000000..1e5c7cda785
--- /dev/null
+++ b/chromium/ash/system/tray/fixed_sized_image_view.h
@@ -0,0 +1,35 @@
+// 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.
+
+#ifndef ASH_SYSTEM_TRAY_FIXED_SIZED_IMAGE_VIEW_H_
+#define ASH_SYSTEM_TRAY_FIXED_SIZED_IMAGE_VIEW_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "ui/views/controls/image_view.h"
+
+namespace ash {
+namespace internal {
+
+// An image view with a specified width and height (kTrayPopupDetailsIconWidth).
+// If the specified width or height is zero, then the image size is used for
+// that dimension.
+class FixedSizedImageView : public views::ImageView {
+ public:
+ FixedSizedImageView(int width, int height);
+ virtual ~FixedSizedImageView();
+
+ private:
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+
+ int width_;
+ int height_;
+
+ DISALLOW_COPY_AND_ASSIGN(FixedSizedImageView);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_FIXED_SIZED_IMAGE_VIEW_H_