| 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 10 matching lines...) Expand all Loading... |
| 21 #include "grit/ash_strings.h" | 21 #include "grit/ash_strings.h" |
| 22 #include "third_party/skia/include/core/SkCanvas.h" | 22 #include "third_party/skia/include/core/SkCanvas.h" |
| 23 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
| 24 #include "third_party/skia/include/core/SkPaint.h" | 24 #include "third_party/skia/include/core/SkPaint.h" |
| 25 #include "third_party/skia/include/core/SkPath.h" | 25 #include "third_party/skia/include/core/SkPath.h" |
| 26 #include "ui/aura/root_window.h" | 26 #include "ui/aura/root_window.h" |
| 27 #include "ui/base/events.h" | 27 #include "ui/base/events.h" |
| 28 #include "ui/base/accessibility/accessible_view_state.h" | 28 #include "ui/base/accessibility/accessible_view_state.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/gfx/canvas.h" | 30 #include "ui/gfx/canvas.h" |
| 31 #include "ui/gfx/monitor.h" |
| 31 #include "ui/gfx/screen.h" | 32 #include "ui/gfx/screen.h" |
| 32 #include "ui/gfx/skia_util.h" | 33 #include "ui/gfx/skia_util.h" |
| 33 #include "ui/views/border.h" | 34 #include "ui/views/border.h" |
| 34 #include "ui/views/bubble/bubble_delegate.h" | 35 #include "ui/views/bubble/bubble_delegate.h" |
| 35 #include "ui/views/controls/label.h" | 36 #include "ui/views/controls/label.h" |
| 36 #include "ui/views/layout/fill_layout.h" | 37 #include "ui/views/layout/fill_layout.h" |
| 37 #include "ui/views/layout/box_layout.h" | 38 #include "ui/views/layout/box_layout.h" |
| 38 #include "ui/views/view.h" | 39 #include "ui/views/view.h" |
| 39 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
| 40 | 41 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 354 } |
| 354 | 355 |
| 355 virtual gfx::Rect GetAnchorRect() OVERRIDE { | 356 virtual gfx::Rect GetAnchorRect() OVERRIDE { |
| 356 views::Widget* widget = tray_->GetWidget(); | 357 views::Widget* widget = tray_->GetWidget(); |
| 357 if (widget->IsVisible()) { | 358 if (widget->IsVisible()) { |
| 358 gfx::Rect rect = widget->GetWindowScreenBounds(); | 359 gfx::Rect rect = widget->GetWindowScreenBounds(); |
| 359 rect.Inset(0, 0, kPaddingFromRightEdgeOfScreen, | 360 rect.Inset(0, 0, kPaddingFromRightEdgeOfScreen, |
| 360 kPaddingFromBottomOfScreen); | 361 kPaddingFromBottomOfScreen); |
| 361 return rect; | 362 return rect; |
| 362 } | 363 } |
| 363 gfx::Rect rect = gfx::Screen::GetPrimaryMonitorBounds(); | 364 gfx::Rect rect = gfx::Screen::GetPrimaryMonitor()->GetBounds(); |
| 364 return gfx::Rect(rect.width() - kPaddingFromRightEdgeOfScreen, | 365 return gfx::Rect(rect.width() - kPaddingFromRightEdgeOfScreen, |
| 365 rect.height() - kPaddingFromBottomOfScreen, | 366 rect.height() - kPaddingFromBottomOfScreen, |
| 366 0, 0); | 367 0, 0); |
| 367 } | 368 } |
| 368 | 369 |
| 369 // Overridden from views::View. | 370 // Overridden from views::View. |
| 370 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { | 371 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { |
| 371 state->role = ui::AccessibilityTypes::ROLE_WINDOW; | 372 state->role = ui::AccessibilityTypes::ROLE_WINDOW; |
| 372 state->name = l10n_util::GetStringUTF16( | 373 state->name = l10n_util::GetStringUTF16( |
| 373 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); | 374 IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 popup_->Hide(); | 677 popup_->Hide(); |
| 677 } | 678 } |
| 678 } | 679 } |
| 679 return base::EVENT_CONTINUE; | 680 return base::EVENT_CONTINUE; |
| 680 } | 681 } |
| 681 | 682 |
| 682 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { | 683 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { |
| 683 } | 684 } |
| 684 | 685 |
| 685 } // namespace ash | 686 } // namespace ash |
| OLD | NEW |