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

Unified Diff: chrome/browser/ui/webui/chromeos/login/oobe_ui.cc

Issue 2839643002: Have OobeUI handle display observation (Closed)
Patch Set: And also remove the other leftover header Created 3 years, 8 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/ui/webui/chromeos/login/oobe_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index c7941c628158b9a0336d4ff09bfcc470ab02b283..67a09180f5bac8864c7eeb94d27566b619f847ae 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -78,6 +78,8 @@
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/web_ui_util.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
namespace chromeos {
@@ -331,10 +333,13 @@ OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
// TabHelper is required for OOBE webui to make webview working on it.
content::WebContents* contents = web_ui->GetWebContents();
extensions::TabHelper::CreateForWebContents(contents);
+
+ display::Screen::GetScreen()->AddObserver(this);
}
OobeUI::~OobeUI() {
network_dropdown_handler_->RemoveObserver(GetView<ErrorScreenHandler>());
+ display::Screen::GetScreen()->RemoveObserver(this);
if (ash_util::IsRunningInMash()) {
// TODO: Ash needs to expose screen dimming api. See
// http://crbug.com/646034.
@@ -435,6 +440,23 @@ UserBoardView* OobeUI::GetUserBoardView() {
return GetView<UserBoardScreenHandler>();
}
+void OobeUI::OnDisplayAdded(const display::Display& new_display) {}
+
+void OobeUI::OnDisplayRemoved(const display::Display& old_display) {}
+
+void OobeUI::OnDisplayMetricsChanged(const display::Display& display,
+ uint32_t changed_metrics) {
+ display::Display primary_display =
+ display::Screen::GetScreen()->GetPrimaryDisplay();
+ if (display.id() != primary_display.id() ||
+ !(changed_metrics & DISPLAY_METRIC_BOUNDS)) {
+ return;
+ }
+
+ const gfx::Size& size = primary_display.size();
+ GetCoreOobeView()->SetClientAreaSize(size.width(), size.height());
+}
+
void OobeUI::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
core_handler_->UpdateShutdownAndRebootVisibility(reboot_on_shutdown);
}
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/oobe_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698