| 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.h" |
| 5 #include "ash/shelf/shelf_layout_manager.h" | 6 #include "ash/shelf/shelf_layout_manager.h" |
| 6 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 7 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 8 #include "base/macros.h" | 9 #include "base/macros.h" |
| 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 10 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 10 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" | 11 #include "chrome/browser/chromeos/accessibility/chromevox_panel.h" |
| 11 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 12 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 12 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
| 13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 14 #include "extensions/browser/view_type_utils.h" | 15 #include "extensions/browser/view_type_utils.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 aura::Window* ChromeVoxPanel::GetRootWindow() { | 99 aura::Window* ChromeVoxPanel::GetRootWindow() { |
| 99 return GetWidget()->GetNativeWindow()->GetRootWindow(); | 100 return GetWidget()->GetNativeWindow()->GetRootWindow(); |
| 100 } | 101 } |
| 101 | 102 |
| 102 void ChromeVoxPanel::Close() { | 103 void ChromeVoxPanel::Close() { |
| 103 widget_->Close(); | 104 widget_->Close(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { | 107 void ChromeVoxPanel::DidFirstVisuallyNonEmptyPaint() { |
| 107 widget_->Show(); | 108 widget_->Show(); |
| 108 ash::ShelfLayoutManager::ForShelf(GetRootWindow()) | 109 ash::Shelf::ForWindow(GetRootWindow()) |
| 110 ->shelf_layout_manager() |
| 109 ->SetChromeVoxPanelHeight(kPanelHeight); | 111 ->SetChromeVoxPanelHeight(kPanelHeight); |
| 110 } | 112 } |
| 111 | 113 |
| 112 void ChromeVoxPanel::EnterFullscreen() { | 114 void ChromeVoxPanel::EnterFullscreen() { |
| 113 fullscreen_ = true; | 115 fullscreen_ = true; |
| 114 widget_->widget_delegate()->set_can_activate(true); | 116 widget_->widget_delegate()->set_can_activate(true); |
| 115 widget_->Activate(); | 117 widget_->Activate(); |
| 116 web_view_->RequestFocus(); | 118 web_view_->RequestFocus(); |
| 117 UpdateWidgetBounds(); | 119 UpdateWidgetBounds(); |
| 118 } | 120 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 148 uint32_t changed_metrics) { | 150 uint32_t changed_metrics) { |
| 149 UpdateWidgetBounds(); | 151 UpdateWidgetBounds(); |
| 150 } | 152 } |
| 151 | 153 |
| 152 void ChromeVoxPanel::UpdateWidgetBounds() { | 154 void ChromeVoxPanel::UpdateWidgetBounds() { |
| 153 gfx::Rect bounds(GetRootWindow()->bounds().size()); | 155 gfx::Rect bounds(GetRootWindow()->bounds().size()); |
| 154 if (!fullscreen_) | 156 if (!fullscreen_) |
| 155 bounds.set_height(kPanelHeight); | 157 bounds.set_height(kPanelHeight); |
| 156 widget_->SetBounds(bounds); | 158 widget_->SetBounds(bounds); |
| 157 } | 159 } |
| OLD | NEW |