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/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/audio/tray_volume.h" | 10 #include "ash/system/audio/tray_volume.h" |
11 #include "ash/system/bluetooth/tray_bluetooth.h" | 11 #include "ash/system/bluetooth/tray_bluetooth.h" |
12 #include "ash/system/brightness/tray_brightness.h" | 12 #include "ash/system/brightness/tray_brightness.h" |
13 #include "ash/system/date/tray_date.h" | 13 #include "ash/system/date/tray_date.h" |
14 #include "ash/system/drive/tray_drive.h" | |
14 #include "ash/system/ime/tray_ime.h" | 15 #include "ash/system/ime/tray_ime.h" |
15 #include "ash/system/network/tray_network.h" | 16 #include "ash/system/network/tray_network.h" |
16 #include "ash/system/power/power_status_observer.h" | 17 #include "ash/system/power/power_status_observer.h" |
17 #include "ash/system/power/power_supply_status.h" | 18 #include "ash/system/power/power_supply_status.h" |
18 #include "ash/system/power/tray_power.h" | 19 #include "ash/system/power/tray_power.h" |
19 #include "ash/system/settings/tray_settings.h" | 20 #include "ash/system/settings/tray_settings.h" |
20 #include "ash/system/tray/tray_empty.h" | 21 #include "ash/system/tray/tray_empty.h" |
21 #include "ash/system/tray/tray_constants.h" | 22 #include "ash/system/tray/tray_constants.h" |
22 #include "ash/system/tray/system_tray_delegate.h" | 23 #include "ash/system/tray/system_tray_delegate.h" |
23 #include "ash/system/tray/system_tray_item.h" | 24 #include "ash/system/tray/system_tray_item.h" |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
451 NetworkIconInfo::~NetworkIconInfo() { | 452 NetworkIconInfo::~NetworkIconInfo() { |
452 } | 453 } |
453 | 454 |
454 BluetoothDeviceInfo::BluetoothDeviceInfo() | 455 BluetoothDeviceInfo::BluetoothDeviceInfo() |
455 : connected(false) { | 456 : connected(false) { |
456 } | 457 } |
457 | 458 |
458 BluetoothDeviceInfo::~BluetoothDeviceInfo() { | 459 BluetoothDeviceInfo::~BluetoothDeviceInfo() { |
459 } | 460 } |
460 | 461 |
462 DriveOperationStatus::DriveOperationStatus() | |
463 : progress(0.0), type(OPERATION_OTHER), state(OPERATION_NOT_STARTED) { | |
xiyuan
2012/05/01 16:47:53
nit: each member on its own line
| |
464 } | |
465 | |
466 DriveOperationStatus::~DriveOperationStatus() { | |
467 } | |
468 | |
461 IMEInfo::IMEInfo() | 469 IMEInfo::IMEInfo() |
462 : selected(false) { | 470 : selected(false) { |
463 } | 471 } |
464 | 472 |
465 IMEInfo::~IMEInfo() { | 473 IMEInfo::~IMEInfo() { |
466 } | 474 } |
467 | 475 |
468 IMEPropertyInfo::IMEPropertyInfo() | 476 IMEPropertyInfo::IMEPropertyInfo() |
469 : selected(false) { | 477 : selected(false) { |
470 } | 478 } |
471 | 479 |
472 IMEPropertyInfo::~IMEPropertyInfo() { | 480 IMEPropertyInfo::~IMEPropertyInfo() { |
473 } | 481 } |
474 | 482 |
475 SystemTray::SystemTray() | 483 SystemTray::SystemTray() |
476 : items_(), | 484 : items_(), |
477 accessibility_observer_(NULL), | 485 accessibility_observer_(NULL), |
478 audio_observer_(NULL), | 486 audio_observer_(NULL), |
479 bluetooth_observer_(NULL), | 487 bluetooth_observer_(NULL), |
480 brightness_observer_(NULL), | 488 brightness_observer_(NULL), |
481 caps_lock_observer_(NULL), | 489 caps_lock_observer_(NULL), |
482 clock_observer_(NULL), | 490 clock_observer_(NULL), |
491 drive_observer_(NULL), | |
483 ime_observer_(NULL), | 492 ime_observer_(NULL), |
484 network_observer_(NULL), | 493 network_observer_(NULL), |
485 power_status_observer_(NULL), | 494 power_status_observer_(NULL), |
486 update_observer_(NULL), | 495 update_observer_(NULL), |
487 user_observer_(NULL), | 496 user_observer_(NULL), |
488 widget_(NULL), | 497 widget_(NULL), |
489 bubble_(NULL), | 498 bubble_(NULL), |
490 popup_(NULL), | 499 popup_(NULL), |
491 background_(new internal::SystemTrayBackground), | 500 background_(new internal::SystemTrayBackground), |
492 should_show_launcher_(false), | 501 should_show_launcher_(false), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
526 internal::TrayVolume* tray_volume = new internal::TrayVolume(); | 535 internal::TrayVolume* tray_volume = new internal::TrayVolume(); |
527 internal::TrayBluetooth* tray_bluetooth = new internal::TrayBluetooth(); | 536 internal::TrayBluetooth* tray_bluetooth = new internal::TrayBluetooth(); |
528 internal::TrayBrightness* tray_brightness = new internal::TrayBrightness(); | 537 internal::TrayBrightness* tray_brightness = new internal::TrayBrightness(); |
529 internal::TrayDate* tray_date = new internal::TrayDate(); | 538 internal::TrayDate* tray_date = new internal::TrayDate(); |
530 internal::TrayPower* tray_power = new internal::TrayPower(); | 539 internal::TrayPower* tray_power = new internal::TrayPower(); |
531 internal::TrayNetwork* tray_network = new internal::TrayNetwork; | 540 internal::TrayNetwork* tray_network = new internal::TrayNetwork; |
532 internal::TrayUser* tray_user = new internal::TrayUser; | 541 internal::TrayUser* tray_user = new internal::TrayUser; |
533 internal::TrayAccessibility* tray_accessibility = | 542 internal::TrayAccessibility* tray_accessibility = |
534 new internal::TrayAccessibility; | 543 new internal::TrayAccessibility; |
535 internal::TrayCapsLock* tray_caps_lock = new internal::TrayCapsLock; | 544 internal::TrayCapsLock* tray_caps_lock = new internal::TrayCapsLock; |
545 internal::TrayDrive* tray_drive = new internal::TrayDrive; | |
536 internal::TrayIME* tray_ime = new internal::TrayIME; | 546 internal::TrayIME* tray_ime = new internal::TrayIME; |
537 internal::TrayUpdate* tray_update = new internal::TrayUpdate; | 547 internal::TrayUpdate* tray_update = new internal::TrayUpdate; |
538 | 548 |
539 accessibility_observer_ = tray_accessibility; | 549 accessibility_observer_ = tray_accessibility; |
540 audio_observer_ = tray_volume; | 550 audio_observer_ = tray_volume; |
541 bluetooth_observer_ = tray_bluetooth; | 551 bluetooth_observer_ = tray_bluetooth; |
542 brightness_observer_ = tray_brightness; | 552 brightness_observer_ = tray_brightness; |
543 caps_lock_observer_ = tray_caps_lock; | 553 caps_lock_observer_ = tray_caps_lock; |
544 clock_observer_ = tray_date; | 554 clock_observer_ = tray_date; |
555 drive_observer_ = tray_drive; | |
545 ime_observer_ = tray_ime; | 556 ime_observer_ = tray_ime; |
546 network_observer_ = tray_network; | 557 network_observer_ = tray_network; |
547 power_status_observer_ = tray_power; | 558 power_status_observer_ = tray_power; |
548 update_observer_ = tray_update; | 559 update_observer_ = tray_update; |
549 user_observer_ = tray_user; | 560 user_observer_ = tray_user; |
550 | 561 |
551 AddTrayItem(tray_user); | 562 AddTrayItem(tray_user); |
552 AddTrayItem(new internal::TrayEmpty()); | 563 AddTrayItem(new internal::TrayEmpty()); |
553 AddTrayItem(tray_power); | 564 AddTrayItem(tray_power); |
554 AddTrayItem(tray_network); | 565 AddTrayItem(tray_network); |
555 AddTrayItem(tray_bluetooth); | 566 AddTrayItem(tray_bluetooth); |
567 AddTrayItem(tray_drive); | |
556 AddTrayItem(tray_ime); | 568 AddTrayItem(tray_ime); |
557 AddTrayItem(tray_volume); | 569 AddTrayItem(tray_volume); |
558 AddTrayItem(tray_brightness); | 570 AddTrayItem(tray_brightness); |
559 AddTrayItem(tray_update); | 571 AddTrayItem(tray_update); |
560 AddTrayItem(tray_accessibility); | 572 AddTrayItem(tray_accessibility); |
561 AddTrayItem(tray_caps_lock); | 573 AddTrayItem(tray_caps_lock); |
562 AddTrayItem(new internal::TraySettings()); | 574 AddTrayItem(new internal::TraySettings()); |
563 AddTrayItem(tray_date); | 575 AddTrayItem(tray_date); |
564 SetVisible(ash::Shell::GetInstance()->tray_delegate()-> | 576 SetVisible(ash::Shell::GetInstance()->tray_delegate()-> |
565 GetTrayVisibilityOnStartup()); | 577 GetTrayVisibilityOnStartup()); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
766 popup_->Hide(); | 778 popup_->Hide(); |
767 } | 779 } |
768 } | 780 } |
769 return base::EVENT_CONTINUE; | 781 return base::EVENT_CONTINUE; |
770 } | 782 } |
771 | 783 |
772 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { | 784 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { |
773 } | 785 } |
774 | 786 |
775 } // namespace ash | 787 } // namespace ash |
OLD | NEW |