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/bluetooth/tray_bluetooth.h" | 5 #include "ash/system/bluetooth/tray_bluetooth.h" |
6 | 6 |
7 #include "ash/session/session_state_delegate.h" | |
7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
8 #include "ash/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/system/tray/fixed_sized_scroll_view.h" |
9 #include "ash/system/tray/hover_highlight_view.h" | 10 #include "ash/system/tray/hover_highlight_view.h" |
10 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/system_tray_notifier.h" | 13 #include "ash/system/tray/system_tray_notifier.h" |
13 #include "ash/system/tray/throbber_view.h" | 14 #include "ash/system/tray/throbber_view.h" |
14 #include "ash/system/tray/tray_constants.h" | 15 #include "ash/system/tray/tray_constants.h" |
15 #include "ash/system/tray/tray_details_view.h" | 16 #include "ash/system/tray/tray_details_view.h" |
16 #include "ash/system/tray/tray_item_more.h" | 17 #include "ash/system/tray/tray_item_more.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 | 295 |
295 // Add settings entries. | 296 // Add settings entries. |
296 void AppendSettingsEntries() { | 297 void AppendSettingsEntries() { |
297 if (!ash::Shell::GetInstance()-> | 298 if (!ash::Shell::GetInstance()-> |
298 system_tray_delegate()->ShouldShowSettings()) { | 299 system_tray_delegate()->ShouldShowSettings()) { |
299 return; | 300 return; |
300 } | 301 } |
301 | 302 |
302 // Add bluetooth device requires a browser window, hide it for non logged in | 303 // Add bluetooth device requires a browser window, hide it for non logged in |
303 // user. | 304 // user. |
304 if (login_ == user::LOGGED_IN_NONE || login_ == user::LOGGED_IN_LOCKED) | 305 if (login_ == user::LOGGED_IN_NONE || login_ == user::LOGGED_IN_LOCKED || |
306 ash::Shell::GetInstance() | |
307 ->session_state_delegate() | |
308 ->GetSessionState() == | |
309 ash::SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY) | |
oshima
2014/07/31 18:28:31
Am I correct that many checks are basically "if a
Roman Sorokin (ftl)
2014/07/31 18:51:32
This method does exist (IsUserSessionBlocked) but
| |
305 return; | 310 return; |
oshima
2014/07/31 18:28:31
you need {} in this case
| |
306 | 311 |
307 ash::SystemTrayDelegate* delegate = | 312 ash::SystemTrayDelegate* delegate = |
308 ash::Shell::GetInstance()->system_tray_delegate(); | 313 ash::Shell::GetInstance()->system_tray_delegate(); |
309 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 314 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
310 HoverHighlightView* container = new HoverHighlightView(this); | 315 HoverHighlightView* container = new HoverHighlightView(this); |
311 container->AddLabel( | 316 container->AddLabel( |
312 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BLUETOOTH_MANAGE_DEVICES), | 317 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BLUETOOTH_MANAGE_DEVICES), |
313 gfx::ALIGN_LEFT, | 318 gfx::ALIGN_LEFT, |
314 gfx::Font::NORMAL); | 319 gfx::Font::NORMAL); |
315 container->SetEnabled(delegate->GetBluetoothAvailable()); | 320 container->SetEnabled(delegate->GetBluetoothAvailable()); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 detailed_->Update(); | 466 detailed_->Update(); |
462 } | 467 } |
463 | 468 |
464 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 469 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
465 if (!detailed_) | 470 if (!detailed_) |
466 return; | 471 return; |
467 detailed_->Update(); | 472 detailed_->Update(); |
468 } | 473 } |
469 | 474 |
470 } // namespace ash | 475 } // namespace ash |
OLD | NEW |