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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/system/tray/tray_item_more.h"
6
7 #include "ash/system/tray/system_tray_item.h"
8 #include "ash/system/tray/tray_constants.h"
9 #include "grit/ui_resources.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/gfx/image/image.h"
12 #include "ui/views/controls/image_view.h"
13
14 namespace ash {
15 namespace internal {
16
17 TrayItemMore::TrayItemMore(SystemTrayItem* owner)
18 : owner_(owner),
19 more_(NULL) {
20 }
21
22 TrayItemMore::~TrayItemMore() {
23 }
24
25 void TrayItemMore::AddMore() {
26 more_ = new views::ImageView;
27 more_->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
28 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.
29 AddChildView(more_);
30 }
31
32 void TrayItemMore::Layout() {
33 // Let the box-layout do the layout first. Then move the '>' arrow to right
34 // align.
35 views::View::Layout();
36
37 gfx::Rect bounds = more_->bounds();
38 bounds.set_x(width() - more_->width() - kTrayPopupPaddingBetweenItems);
39 more_->SetBoundsRect(bounds);
40 }
41
42 bool TrayItemMore::OnMousePressed(const views::MouseEvent& event) OVERRIDE {
43 owner_->PopupDetailedView(0, true);
44 return true;
45 }
46
47 } // namespace internal
48 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698