Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2451)

Unified Diff: ash/system/tray/tray_item_more.cc

Issue 9753019: ash: Add a bluetooth entry in the uber tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698