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

Unified Diff: chrome/browser/chromeos/arc/arc_support_host.cc

Issue 2142933006: arc: Implement scrollable OptIn window content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style changes Created 4 years, 5 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
Index: chrome/browser/chromeos/arc/arc_support_host.cc
diff --git a/chrome/browser/chromeos/arc/arc_support_host.cc b/chrome/browser/chromeos/arc/arc_support_host.cc
index ace97f760378bbdee254134ba1a5c9baa023af6f..f34771731e0e443b62edd325f2df5f5c621cdc3d 100644
--- a/chrome/browser/chromeos/arc/arc_support_host.cc
+++ b/chrome/browser/chromeos/arc/arc_support_host.cc
@@ -26,6 +26,7 @@
#include "components/user_manager/known_user.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/webui/web_ui_util.h"
+#include "ui/display/screen.h"
namespace {
const char kAction[] = "action";
@@ -41,6 +42,7 @@ const char kStatus[] = "status";
const char kText[] = "text";
const char kActionInitialize[] = "initialize";
const char kActionSetMetricsMode[] = "setMetricsMode";
+const char kActionSetWindowBounds[] = "setWindowBounds";
const char kActionStartLso[] = "startLso";
const char kActionCancelAuthCode[] = "cancelAuthCode";
const char kActionSetAuthCode[] = "setAuthCode";
@@ -73,6 +75,7 @@ ArcSupportHost::ArcSupportHost() {
arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get();
DCHECK(arc_auth_service);
arc_auth_service->AddObserver(this);
+ display::Screen::GetScreen()->AddObserver(this);
pref_change_registrar_.Init(g_browser_process->local_state());
pref_change_registrar_.Add(
@@ -82,6 +85,7 @@ ArcSupportHost::ArcSupportHost() {
}
ArcSupportHost::~ArcSupportHost() {
+ display::Screen::GetScreen()->RemoveObserver(this);
arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get();
if (arc_auth_service)
arc_auth_service->RemoveObserver(this);
@@ -167,6 +171,19 @@ void ArcSupportHost::Initialize() {
client_->PostMessageFromNativeHost(request_string);
}
+void ArcSupportHost::OnDisplayAdded(const display::Display& new_display) {}
+
+void ArcSupportHost::OnDisplayRemoved(const display::Display& old_display) {}
+
+void ArcSupportHost::OnDisplayMetricsChanged(const display::Display& display,
+ uint32_t changed_metrics) {
+ base::DictionaryValue request;
+ std::string request_string;
+ request.SetString(kAction, kActionSetWindowBounds);
+ base::JSONWriter::Write(request, &request_string);
+ client_->PostMessageFromNativeHost(request_string);
+}
+
void ArcSupportHost::OnMetricsPreferenceChanged() {
SendMetricsMode();
}
« no previous file with comments | « chrome/browser/chromeos/arc/arc_support_host.h ('k') | chrome/browser/resources/chromeos/arc_support/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698