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

Side by Side Diff: chrome/browser/chromeos/arc/arc_support_host.h

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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_support_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SUPPORT_HOST_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SUPPORT_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SUPPORT_HOST_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SUPPORT_HOST_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/chromeos/arc/arc_auth_service.h" 9 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
10 #include "components/prefs/pref_change_registrar.h" 10 #include "components/prefs/pref_change_registrar.h"
11 #include "extensions/browser/api/messaging/native_message_host.h" 11 #include "extensions/browser/api/messaging/native_message_host.h"
12 #include "ui/display/display_observer.h"
12 13
13 // Supports communication with Arc support dialog. 14 // Supports communication with Arc support dialog.
14 class ArcSupportHost : public extensions::NativeMessageHost, 15 class ArcSupportHost : public extensions::NativeMessageHost,
15 public arc::ArcAuthService::Observer { 16 public arc::ArcAuthService::Observer,
17 public display::DisplayObserver {
16 public: 18 public:
17 static const char kHostName[]; 19 static const char kHostName[];
18 static const char kHostAppId[]; 20 static const char kHostAppId[];
19 static const char kStorageId[]; 21 static const char kStorageId[];
20 static const char* const kHostOrigin[]; 22 static const char* const kHostOrigin[];
21 23
22 static std::unique_ptr<NativeMessageHost> Create(); 24 static std::unique_ptr<NativeMessageHost> Create();
23 25
24 ~ArcSupportHost() override; 26 ~ArcSupportHost() override;
25 27
26 // Overrides NativeMessageHost: 28 // Overrides NativeMessageHost:
27 void Start(Client* client) override; 29 void Start(Client* client) override;
28 void OnMessage(const std::string& request_string) override; 30 void OnMessage(const std::string& request_string) override;
29 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const override; 31 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const override;
30 32
31 // Overrides arc::ArcAuthService::Observer: 33 // Overrides arc::ArcAuthService::Observer:
32 void OnOptInUIClose() override; 34 void OnOptInUIClose() override;
33 void OnOptInUIShowPage(arc::ArcAuthService::UIPage page, 35 void OnOptInUIShowPage(arc::ArcAuthService::UIPage page,
34 const base::string16& status) override; 36 const base::string16& status) override;
35 37
38 // display::DisplayObserver:
39 void OnDisplayAdded(const display::Display& new_display) override;
40 void OnDisplayRemoved(const display::Display& old_display) override;
41 void OnDisplayMetricsChanged(const display::Display& display,
42 uint32_t changed_metrics) override;
43
36 private: 44 private:
37 ArcSupportHost(); 45 ArcSupportHost();
38 46
39 void OnMetricsPreferenceChanged(); 47 void OnMetricsPreferenceChanged();
40 void Initialize(); 48 void Initialize();
41 void SendMetricsMode(); 49 void SendMetricsMode();
42 void EnableMetrics(bool is_enabled); 50 void EnableMetrics(bool is_enabled);
43 void EnableBackupRestore(bool is_enabled); 51 void EnableBackupRestore(bool is_enabled);
44 52
45 // Unowned pointer. 53 // Unowned pointer.
46 Client* client_ = nullptr; 54 Client* client_ = nullptr;
47 55
48 // Used to track metrics preference. 56 // Used to track metrics preference.
49 PrefChangeRegistrar pref_change_registrar_; 57 PrefChangeRegistrar pref_change_registrar_;
50 58
51 DISALLOW_COPY_AND_ASSIGN(ArcSupportHost); 59 DISALLOW_COPY_AND_ASSIGN(ArcSupportHost);
52 }; 60 };
53 61
54 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SUPPORT_HOST_H_ 62 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SUPPORT_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_support_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698