| 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/settings/tray_settings.h" | 5 #include "ash/system/settings/tray_settings.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 30 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
| 31 ash::kTrayPopupPaddingHorizontal, 0, | 31 ash::kTrayPopupPaddingHorizontal, 0, |
| 32 ash::kTrayPopupPaddingBetweenItems)); | 32 ash::kTrayPopupPaddingBetweenItems)); |
| 33 | 33 |
| 34 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 34 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 35 views::ImageView* icon = | 35 views::ImageView* icon = |
| 36 new ash::internal::FixedSizedImageView(0, ash::kTrayPopupItemHeight); | 36 new ash::internal::FixedSizedImageView(0, ash::kTrayPopupItemHeight); |
| 37 icon->SetImage(rb.GetImageNamed(IDR_AURA_UBER_TRAY_SETTINGS).ToSkBitmap()); | 37 icon->SetImage(rb.GetImageNamed(IDR_AURA_UBER_TRAY_SETTINGS).ToSkBitmap()); |
| 38 AddChildView(icon); | 38 AddChildView(icon); |
| 39 | 39 |
| 40 label_ = new views::Label(rb.GetLocalizedString( | 40 string16 text = rb.GetLocalizedString( |
| 41 IDS_ASH_STATUS_TRAY_SETTINGS_AND_HELP)); | 41 IDS_ASH_STATUS_TRAY_SETTINGS_AND_HELP); |
| 42 label_ = new views::Label(text); |
| 42 AddChildView(label_); | 43 AddChildView(label_); |
| 44 |
| 45 SetAccessibleName(text); |
| 43 } | 46 } |
| 44 | 47 |
| 45 virtual ~SettingsView() {} | 48 virtual ~SettingsView() {} |
| 46 | 49 |
| 47 // Overridden from ash::internal::ActionableView. | 50 // Overridden from ash::internal::ActionableView. |
| 48 virtual bool PerformAction(const views::Event& event) OVERRIDE { | 51 virtual bool PerformAction(const views::Event& event) OVERRIDE { |
| 49 ash::Shell::GetInstance()->tray_delegate()->ShowSettings(); | 52 ash::Shell::GetInstance()->tray_delegate()->ShowSettings(); |
| 50 return true; | 53 return true; |
| 51 } | 54 } |
| 52 | 55 |
| 53 // Overridden from views::View. | |
| 54 void GetAccessibleState(ui::AccessibleViewState* state) { | |
| 55 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | |
| 56 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | |
| 57 state->name = rb.GetLocalizedString( | |
| 58 IDS_ASH_STATUS_TRAY_SETTINGS_AND_HELP); | |
| 59 } | |
| 60 | |
| 61 private: | 56 private: |
| 62 views::Label* label_; | 57 views::Label* label_; |
| 63 | 58 |
| 64 DISALLOW_COPY_AND_ASSIGN(SettingsView); | 59 DISALLOW_COPY_AND_ASSIGN(SettingsView); |
| 65 }; | 60 }; |
| 66 | 61 |
| 67 } // namespace | 62 } // namespace |
| 68 | 63 |
| 69 namespace ash { | 64 namespace ash { |
| 70 namespace internal { | 65 namespace internal { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 93 } | 88 } |
| 94 | 89 |
| 95 void TraySettings::DestroyDefaultView() { | 90 void TraySettings::DestroyDefaultView() { |
| 96 } | 91 } |
| 97 | 92 |
| 98 void TraySettings::DestroyDetailedView() { | 93 void TraySettings::DestroyDetailedView() { |
| 99 } | 94 } |
| 100 | 95 |
| 101 } // namespace internal | 96 } // namespace internal |
| 102 } // namespace ash | 97 } // namespace ash |
| OLD | NEW |