| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { | 106 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { |
| 107 widget_->Show(); | 107 widget_->Show(); |
| 108 ash::ShelfLayoutManager::ForShelf(GetRootWindow()) | 108 ash::ShelfLayoutManager::ForShelf(GetRootWindow()) |
| 109 ->SetChromeVoxPanelHeight(kPanelHeight); | 109 ->SetChromeVoxPanelHeight(kPanelHeight); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void ChromeVoxPanel::EnterFullscreen() { | 112 void ChromeVoxPanel::EnterFullscreen() { |
| 113 fullscreen_ = true; | 113 fullscreen_ = true; |
| 114 widget_->widget_delegate()->set_can_activate(true); | |
| 115 widget_->Activate(); | |
| 116 web_view_->RequestFocus(); | |
| 117 UpdateWidgetBounds(); | 114 UpdateWidgetBounds(); |
| 118 } | 115 } |
| 119 | 116 |
| 120 void ChromeVoxPanel::ExitFullscreen() { | 117 void ChromeVoxPanel::ExitFullscreen() { |
| 121 widget_->widget_delegate()->set_can_activate(false); | |
| 122 fullscreen_ = false; | 118 fullscreen_ = false; |
| 123 UpdateWidgetBounds(); | 119 UpdateWidgetBounds(); |
| 124 } | 120 } |
| 125 | 121 |
| 126 void ChromeVoxPanel::DisableSpokenFeedback() { | 122 void ChromeVoxPanel::DisableSpokenFeedback() { |
| 127 chromeos::AccessibilityManager::Get()->EnableSpokenFeedback( | 123 chromeos::AccessibilityManager::Get()->EnableSpokenFeedback( |
| 128 false, ui::A11Y_NOTIFICATION_NONE); | 124 false, ui::A11Y_NOTIFICATION_NONE); |
| 129 } | 125 } |
| 130 | 126 |
| 131 const views::Widget* ChromeVoxPanel::GetWidget() const { | 127 const views::Widget* ChromeVoxPanel::GetWidget() const { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 148 uint32_t changed_metrics) { | 144 uint32_t changed_metrics) { |
| 149 UpdateWidgetBounds(); | 145 UpdateWidgetBounds(); |
| 150 } | 146 } |
| 151 | 147 |
| 152 void ChromeVoxPanel::UpdateWidgetBounds() { | 148 void ChromeVoxPanel::UpdateWidgetBounds() { |
| 153 gfx::Rect bounds(GetRootWindow()->bounds().size()); | 149 gfx::Rect bounds(GetRootWindow()->bounds().size()); |
| 154 if (!fullscreen_) | 150 if (!fullscreen_) |
| 155 bounds.set_height(kPanelHeight); | 151 bounds.set_height(kPanelHeight); |
| 156 widget_->SetBounds(bounds); | 152 widget_->SetBounds(bounds); |
| 157 } | 153 } |
| OLD | NEW |