Chromium Code Reviews| 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..7c4b064137c3bc03a519978de8b63a223a52e82c |
| --- /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()); |
|
Ben Goodger (Google)
2012/03/21 15:52:14
weird indent
sadrul
2012/03/21 16:16:42
Fixed.
|
| + 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 |