OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
7 #include "ash/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
10 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" | 10 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 aura::Window* root_window = ash::Shell::GetPrimaryRootWindow(); | 81 aura::Window* root_window = ash::Shell::GetPrimaryRootWindow(); |
82 params.parent = ash::Shell::GetContainer( | 82 params.parent = ash::Shell::GetContainer( |
83 root_window, ash::kShellWindowId_SettingBubbleContainer); | 83 root_window, ash::kShellWindowId_SettingBubbleContainer); |
84 params.delegate = this; | 84 params.delegate = this; |
85 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 85 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
86 params.bounds = gfx::Rect(0, 0, root_window->bounds().width(), | 86 params.bounds = gfx::Rect(0, 0, root_window->bounds().width(), |
87 root_window->bounds().height()); | 87 root_window->bounds().height()); |
88 widget_->Init(params); | 88 widget_->Init(params); |
89 SetShadowType(widget_->GetNativeWindow(), wm::SHADOW_TYPE_RECTANGULAR); | 89 SetShadowType(widget_->GetNativeWindow(), wm::SHADOW_TYPE_RECTANGULAR); |
90 | 90 |
91 ash::Shell::GetScreen()->AddObserver(this); | 91 gfx::Screen::GetScreen()->AddObserver(this); |
92 } | 92 } |
93 | 93 |
94 ChromeVoxPanel::~ChromeVoxPanel() { | 94 ChromeVoxPanel::~ChromeVoxPanel() { |
95 ash::Shell::GetScreen()->RemoveObserver(this); | 95 gfx::Screen::GetScreen()->RemoveObserver(this); |
96 } | 96 } |
97 | 97 |
98 aura::Window* ChromeVoxPanel::GetRootWindow() { | 98 aura::Window* ChromeVoxPanel::GetRootWindow() { |
99 return GetWidget()->GetNativeWindow()->GetRootWindow(); | 99 return GetWidget()->GetNativeWindow()->GetRootWindow(); |
100 } | 100 } |
101 | 101 |
102 void ChromeVoxPanel::Close() { | 102 void ChromeVoxPanel::Close() { |
103 widget_->Close(); | 103 widget_->Close(); |
104 } | 104 } |
105 | 105 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 uint32_t changed_metrics) { | 144 uint32_t changed_metrics) { |
145 UpdateWidgetBounds(); | 145 UpdateWidgetBounds(); |
146 } | 146 } |
147 | 147 |
148 void ChromeVoxPanel::UpdateWidgetBounds() { | 148 void ChromeVoxPanel::UpdateWidgetBounds() { |
149 gfx::Rect bounds(GetRootWindow()->bounds().size()); | 149 gfx::Rect bounds(GetRootWindow()->bounds().size()); |
150 if (!fullscreen_) | 150 if (!fullscreen_) |
151 bounds.set_height(kPanelHeight); | 151 bounds.set_height(kPanelHeight); |
152 widget_->SetBounds(bounds); | 152 widget_->SetBounds(bounds); |
153 } | 153 } |
OLD | NEW |