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/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); | 344 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); |
345 it != items_.end(); | 345 it != items_.end(); |
346 ++it) { | 346 ++it) { |
347 views::View* view = detailed_ ? (*it)->CreateDetailedView(login_status) : | 347 views::View* view = detailed_ ? (*it)->CreateDetailedView(login_status) : |
348 (*it)->CreateDefaultView(login_status); | 348 (*it)->CreateDefaultView(login_status); |
349 if (view) | 349 if (view) |
350 AddChildView(new TrayPopupItemContainer(view)); | 350 AddChildView(new TrayPopupItemContainer(view)); |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
| 354 virtual gfx::Rect GetAnchorRect() OVERRIDE { |
| 355 gfx::Rect rect = tray_->GetWidget()->GetWindowScreenBounds(); |
| 356 rect.Inset(0, 0, kPaddingFromRightEdgeOfScreen, kPaddingFromBottomOfScreen); |
| 357 return rect; |
| 358 } |
| 359 |
354 // Overridden from views::View. | 360 // Overridden from views::View. |
355 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { | 361 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { |
356 state->role = ui::AccessibilityTypes::ROLE_WINDOW; | 362 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
357 state->name = l10n_util::GetStringUTF16( | 363 state->name = l10n_util::GetStringUTF16( |
358 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); | 364 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); |
359 } | 365 } |
360 | 366 |
361 virtual bool CanActivate() const OVERRIDE { | 367 virtual bool CanActivate() const OVERRIDE { |
362 return can_activate_; | 368 return can_activate_; |
363 } | 369 } |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 popup_->Hide(); | 666 popup_->Hide(); |
661 } | 667 } |
662 } | 668 } |
663 return base::EVENT_CONTINUE; | 669 return base::EVENT_CONTINUE; |
664 } | 670 } |
665 | 671 |
666 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { | 672 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { |
667 } | 673 } |
668 | 674 |
669 } // namespace ash | 675 } // namespace ash |
OLD | NEW |