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..9414fc4dd2f4e89e2b5eac86d28ccd6aef4d9b1a |
--- /dev/null |
+++ b/ash/system/tray/tray_item_more.cc |
@@ -0,0 +1,48 @@ |
+// 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/system_tray_item.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(SystemTrayItem* owner) |
+ : owner_(owner), |
+ 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); |
+} |
+ |
+bool TrayItemMore::OnMousePressed(const views::MouseEvent& event) OVERRIDE { |
+ owner_->PopupDetailedView(0, true); |
+ return true; |
+} |
+ |
+} // namespace internal |
+} // namespace ash |