| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/tray/tray_item_more.h" | 5 #include "ash/system/tray/tray_item_more.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/fixed_sized_image_view.h" | 7 #include "ash/system/tray/fixed_sized_image_view.h" |
| 8 #include "ash/system/tray/system_tray_item.h" | 8 #include "ash/system/tray/system_tray_item.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
| 11 #include "ui/accessibility/ax_view_state.h" | 11 #include "ui/accessibility/ax_view_state.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
| 14 #include "ui/views/controls/image_view.h" | 14 #include "ui/views/controls/image_view.h" |
| 15 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
| 16 #include "ui/views/layout/box_layout.h" | 16 #include "ui/views/layout/box_layout.h" |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace internal { | |
| 20 | 19 |
| 21 TrayItemMore::TrayItemMore(SystemTrayItem* owner, bool show_more) | 20 TrayItemMore::TrayItemMore(SystemTrayItem* owner, bool show_more) |
| 22 : owner_(owner), | 21 : owner_(owner), |
| 23 show_more_(show_more), | 22 show_more_(show_more), |
| 24 icon_(NULL), | 23 icon_(NULL), |
| 25 label_(NULL), | 24 label_(NULL), |
| 26 more_(NULL) { | 25 more_(NULL) { |
| 27 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 26 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
| 28 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); | 27 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); |
| 29 | 28 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 bounds.set_width(more_->x() - kTrayPopupPaddingBetweenItems - label_->x()); | 95 bounds.set_width(more_->x() - kTrayPopupPaddingBetweenItems - label_->x()); |
| 97 label_->SetBoundsRect(bounds); | 96 label_->SetBoundsRect(bounds); |
| 98 } | 97 } |
| 99 } | 98 } |
| 100 | 99 |
| 101 void TrayItemMore::GetAccessibleState(ui::AXViewState* state) { | 100 void TrayItemMore::GetAccessibleState(ui::AXViewState* state) { |
| 102 state->role = ui::AX_ROLE_BUTTON; | 101 state->role = ui::AX_ROLE_BUTTON; |
| 103 state->name = accessible_name_; | 102 state->name = accessible_name_; |
| 104 } | 103 } |
| 105 | 104 |
| 106 } // namespace internal | |
| 107 } // namespace ash | 105 } // namespace ash |
| OLD | NEW |