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

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

Issue 2865003003: Put OOBE UI on touch display if no keyboard detected (Closed)
Patch Set: Add TODO and link to bug Created 3 years, 7 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 325a77fc67cefa01b0b06224edf289c105d93dd6..4497720f2fc1b5934d25c51ee87fe8315c6163f7 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -51,6 +51,7 @@
#include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h"
+#include "chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.h"
#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen_handler.h"
@@ -78,6 +79,9 @@
#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/events/devices/input_device.h"
+#include "ui/events/devices/input_device_manager.h"
namespace chromeos {
@@ -207,6 +211,19 @@ std::string GetDisplayType(const GURL& url) {
return path;
}
+bool IsKeyboardConnected() {
+ const std::vector<ui::InputDevice>& keyboards =
+ ui::InputDeviceManager::GetInstance()->GetKeyboardDevices();
+ for (const ui::InputDevice& keyboard : keyboards) {
+ if (keyboard.type == ui::INPUT_DEVICE_INTERNAL ||
+ keyboard.type == ui::INPUT_DEVICE_EXTERNAL) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
} // namespace
// static
@@ -337,6 +354,11 @@ 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);
+
+ // TODO(felixe): Display iteration and primary display selection not supported
+ // in Mash. See http://crbug.com/720917.
+ if (!ash_util::IsRunningInMash() && !IsKeyboardConnected())
+ oobe_display_chooser_ = base::MakeUnique<OobeDisplayChooser>();
}
OobeUI::~OobeUI() {
@@ -560,6 +582,9 @@ bool OobeUI::IsJSReady(const base::Closure& display_is_ready_callback) {
void OobeUI::ShowOobeUI(bool show) {
core_handler_->ShowOobeUI(show);
+
+ if (show && oobe_display_chooser_)
+ oobe_display_chooser_->TryToPlaceUiOnTouchDisplay();
}
void OobeUI::ShowSigninScreen(const LoginScreenContext& context,
@@ -608,4 +633,9 @@ void OobeUI::UpdateLocalizedStringsIfNeeded() {
static_cast<CoreOobeView*>(core_handler_)->ReloadContent(localized_strings);
}
+void OobeUI::OnDisplayConfigurationChanged() {
+ if (oobe_display_chooser_)
+ oobe_display_chooser_->TryToPlaceUiOnTouchDisplay();
+}
+
} // namespace chromeos
« 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