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

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

Issue 2332893002: Changes ownership of ScreenDimmer (Closed)
Patch Set: merge to tot Created 4 years, 3 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 fc1ec6c545c8954c9e9d18c6ddc3568196b5564c..3e2fe433066961350249e8ee46fbe08b90dd9e5b 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -8,11 +8,11 @@
#include <memory>
-#include "ash/common/shell_window_ids.h"
#include "ash/wm/screen_dimmer.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -361,11 +361,9 @@ OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
OobeUI::~OobeUI() {
core_handler_->SetDelegate(nullptr);
network_dropdown_handler_->RemoveObserver(error_screen_handler_);
- if (!chrome::IsRunningInMash()) {
- ash::ScreenDimmer::GetForContainer(
- ash::kShellWindowId_LockScreenContainersContainer)
- ->SetDimming(false);
- } else {
+ if (chrome::IsRunningInMash()) {
+ // TODO: Ash needs to expose screen dimming api. See
+ // http://crbug.com/646034.
NOTIMPLEMENTED();
}
}
@@ -590,11 +588,15 @@ void OobeUI::OnCurrentScreenChanged(const std::string& screen) {
std::end(kDimOverlayScreenIds),
new_screen) != std::end(kDimOverlayScreenIds);
if (!chrome::IsRunningInMash()) {
- ash::ScreenDimmer* screen_dimmer = ash::ScreenDimmer::GetForContainer(
- ash::kShellWindowId_LockScreenContainersContainer);
- screen_dimmer->set_at_bottom(true);
- screen_dimmer->SetDimming(should_dim);
+ if (!screen_dimmer_) {
+ screen_dimmer_ = base::MakeUnique<ash::ScreenDimmer>(
+ ash::ScreenDimmer::Container::LOCK_SCREEN);
+ }
+ screen_dimmer_->set_at_bottom(true);
+ screen_dimmer_->SetDimming(should_dim);
} else {
+ // TODO: Ash needs to expose screen dimming api. See
+ // http://crbug.com/646034.
NOTIMPLEMENTED();
}
« 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