OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/status/status_area_view_chromeos.h" | 5 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 8 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
9 #include "chrome/browser/chromeos/status/accessibility_menu_button.h" | 9 #include "chrome/browser/chromeos/status/accessibility_menu_button.h" |
10 #include "chrome/browser/chromeos/status/caps_lock_menu_button.h" | 10 #include "chrome/browser/chromeos/status/caps_lock_menu_button.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 UpdateClockText(); | 64 UpdateClockText(); |
65 } | 65 } |
66 | 66 |
67 void StatusAreaViewChromeos::UpdateClockText() { | 67 void StatusAreaViewChromeos::UpdateClockText() { |
68 ClockMenuButton* clock_button = | 68 ClockMenuButton* clock_button = |
69 static_cast<ClockMenuButton*>(GetViewByID(VIEW_ID_STATUS_BUTTON_CLOCK)); | 69 static_cast<ClockMenuButton*>(GetViewByID(VIEW_ID_STATUS_BUTTON_CLOCK)); |
70 if (clock_button) | 70 if (clock_button) |
71 clock_button->UpdateText(); | 71 clock_button->UpdateText(); |
72 } | 72 } |
73 | 73 |
74 void StatusAreaViewChromeos::SetDefaultUse24HourClock(bool use_24hour_clock) { | |
75 ClockMenuButton* clock_button = | |
76 static_cast<ClockMenuButton*>(GetViewByID(VIEW_ID_STATUS_BUTTON_CLOCK)); | |
77 if (clock_button) | |
78 clock_button->SetDefaultUse24HourClock(use_24hour_clock); | |
79 } | |
80 | |
81 // static | 74 // static |
82 void StatusAreaViewChromeos::AddChromeosButtons( | 75 void StatusAreaViewChromeos::AddChromeosButtons( |
83 StatusAreaView* status_area, | 76 StatusAreaView* status_area, |
84 StatusAreaButton::Delegate* delegate, | 77 StatusAreaButton::Delegate* delegate, |
85 ClockMenuButton** clock_button) { | 78 ClockMenuButton** clock_button) { |
86 const bool border = true; | 79 const bool border = true; |
87 const bool no_border = false; | 80 const bool no_border = false; |
88 | 81 |
89 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMemoryWidget)) | 82 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMemoryWidget)) |
90 status_area->AddButton(new MemoryMenuButton(delegate), no_border); | 83 status_area->AddButton(new MemoryMenuButton(delegate), no_border); |
91 | 84 |
92 status_area->AddButton(new AccessibilityMenuButton(delegate), border); | 85 status_area->AddButton(new AccessibilityMenuButton(delegate), border); |
93 status_area->AddButton(new CapsLockMenuButton(delegate), border); | 86 status_area->AddButton(new CapsLockMenuButton(delegate), border); |
94 ClockMenuButton* clock = new ClockMenuButton(delegate); | 87 ClockMenuButton* clock = new ClockMenuButton(delegate); |
95 status_area->AddButton(clock, border); | 88 status_area->AddButton(clock, border); |
96 if (clock_button) | 89 if (clock_button) |
97 *clock_button = clock; | 90 *clock_button = clock; |
98 | 91 |
99 status_area->AddButton(new InputMethodMenuButton(delegate), no_border); | 92 status_area->AddButton(new InputMethodMenuButton(delegate), no_border); |
100 status_area->AddButton(new NetworkMenuButton(delegate), no_border); | 93 status_area->AddButton(new NetworkMenuButton(delegate), no_border); |
101 status_area->AddButton(new PowerMenuButton(delegate), no_border); | 94 status_area->AddButton(new PowerMenuButton(delegate), no_border); |
102 } | 95 } |
103 | 96 |
104 } // namespace chromeos | 97 } // namespace chromeos |
OLD | NEW |