Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: chrome/browser/chromeos/accessibility/chromevox_panel.cc

Issue 1841393002: Hide ChromeVox Panel in full-screen mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shelf_on_login
Patch Set: No need to check window state Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/accessibility/chromevox_panel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3ed98fcabbba8ee9f2b633cf1845d9587d4a0db2 100644
--- a/chrome/browser/chromeos/accessibility/chromevox_panel.cc
+++ b/chrome/browser/chromeos/accessibility/chromevox_panel.cc
@@ -2,6 +2,7 @@
// 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"
@@ -64,7 +65,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 +125,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 +170,16 @@ 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.
+ if (ash::GetRootWindowController(GetRootWindow())
+ ->GetWindowForFullscreenMode() &&
+ !widget_->IsActive()) {
+ bounds.set_height(0);
+ }
+
widget_->SetBounds(bounds);
}
« no previous file with comments | « chrome/browser/chromeos/accessibility/chromevox_panel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698