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

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: . 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
« no previous file with comments | « ash/system/tray/tray_item_more.h ('k') | ash/system/tray/tray_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/system/tray/tray_item_more.h ('k') | ash/system/tray/tray_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698