Index: chrome/browser/chromeos/accessibility/chromevox_panel.cc |
diff --git a/chrome/browser/chromeos/accessibility/chromevox_panel.cc b/chrome/browser/chromeos/accessibility/chromevox_panel.cc |
index aff78c5b3d39bc0b346de91d1b4c352e1d3cefb3..04ccb5789c046aa2dca37bd10eea5614ff63a345 100644 |
--- a/chrome/browser/chromeos/accessibility/chromevox_panel.cc |
+++ b/chrome/browser/chromeos/accessibility/chromevox_panel.cc |
@@ -2,10 +2,12 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "ash/root_window_controller.h" |
#include "ash/shelf/shelf.h" |
#include "ash/shelf/shelf_layout_manager.h" |
#include "ash/shell.h" |
#include "ash/shell_window_ids.h" |
+#include "ash/wm/window_state.h" |
#include "base/macros.h" |
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
#include "chrome/browser/chromeos/accessibility/chromevox_panel.h" |
@@ -64,7 +66,7 @@ class ChromeVoxPanelWebContentsObserver : public content::WebContentsObserver { |
}; |
ChromeVoxPanel::ChromeVoxPanel(content::BrowserContext* browser_context) |
- : widget_(nullptr), web_view_(nullptr), fullscreen_(false) { |
+ : widget_(nullptr), web_view_(nullptr), panel_fullscreen_(false) { |
std::string url("chrome-extension://"); |
url += extension_misc::kChromeVoxExtensionId; |
url += kChromeVoxPanelRelativeUrl; |
@@ -124,13 +126,14 @@ void ChromeVoxPanel::UpdatePanelHeight() { |
void ChromeVoxPanel::EnterFullscreen() { |
Focus(); |
- fullscreen_ = true; |
+ panel_fullscreen_ = true; |
UpdateWidgetBounds(); |
} |
void ChromeVoxPanel::ExitFullscreen() { |
+ widget_->Deactivate(); |
widget_->widget_delegate()->set_can_activate(false); |
- fullscreen_ = false; |
+ panel_fullscreen_ = false; |
UpdateWidgetBounds(); |
} |
@@ -168,7 +171,19 @@ void ChromeVoxPanel::OnDisplayMetricsChanged(const gfx::Display& display, |
void ChromeVoxPanel::UpdateWidgetBounds() { |
gfx::Rect bounds(GetRootWindow()->bounds().size()); |
- if (!fullscreen_) |
+ if (!panel_fullscreen_) |
bounds.set_height(kPanelHeight); |
+ |
+ // If we're in full-screen mode, give the panel a height of 0 unless |
+ // it's active. |
+ const aura::Window* fullscreen_window = |
+ ash::GetRootWindowController(GetRootWindow()) |
+ ->GetWindowForFullscreenMode(); |
+ if (fullscreen_window && |
+ ash::wm::GetWindowState(fullscreen_window)->IsFullscreen() && |
xiyuan
2016/03/30 16:08:02
nit: Is checking IsFullscreen() necessary? |fullsc
dmazzoni
2016/03/31 15:25:56
Ah, thanks. I misinterpreted and thought it return
|
+ !widget_->IsActive()) { |
+ bounds.set_height(0); |
+ } |
+ |
widget_->SetBounds(bounds); |
} |