Index: ash/system/tray/tray_item_more.cc |
diff --git a/ash/system/tray/tray_item_more.cc b/ash/system/tray/tray_item_more.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5f17b66f92c2d23ca1618f1899175e709e6db2eb |
--- /dev/null |
+++ b/ash/system/tray/tray_item_more.cc |
@@ -0,0 +1,41 @@ |
+// 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 "ash/system/tray/tray_item_more.h" |
+ |
+#include "ash/system/tray/tray_constants.h" |
+#include "grit/ui_resources.h" |
+#include "ui/base/resource/resource_bundle.h" |
+#include "ui/gfx/image/image.h" |
+#include "ui/views/controls/image_view.h" |
+ |
+namespace ash { |
+namespace internal { |
+ |
+TrayItemMore::TrayItemMore() |
+ : more_(NULL) { |
+} |
+ |
+TrayItemMore::~TrayItemMore() { |
+} |
+ |
+void TrayItemMore::AddMore() { |
+ more_ = new views::ImageView; |
+ more_->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
+ IDR_AURA_UBER_TRAY_MORE).ToSkBitmap()); |
+ AddChildView(more_); |
+} |
+ |
+void TrayItemMore::Layout() { |
+ // Let the box-layout do the layout first. Then move the '>' arrow to right |
+ // align. |
+ views::View::Layout(); |
+ |
+ gfx::Rect bounds = more_->bounds(); |
+ bounds.set_x(width() - more_->width() - kTrayPopupPaddingBetweenItems); |
+ more_->SetBoundsRect(bounds); |
+} |
+ |
+} // namespace internal |
+} // namespace ash |