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

Side by Side Diff: chrome/browser/android/vr_shell/ui_interface.h

Issue 2461503002: Provide URL-related info to the VR HTML UI. (Closed)
Patch Set: Rebase further ahead to resolve conflict. Created 4 years, 1 month 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
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_ANDROID_VR_SHELL_UI_INTERFACE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
11 class GURL;
12
11 namespace vr_shell { 13 namespace vr_shell {
12 14
13 class UiCommandHandler { 15 class UiCommandHandler {
14 public: 16 public:
15 virtual void SendCommandToUi(const base::Value& value) = 0; 17 virtual void SendCommandToUi(const base::Value& value) = 0;
16 }; 18 };
17 19
18 // This class manages the communication of browser state from VR shell to the 20 // This class manages the communication of browser state from VR shell to the
19 // HTML UI. State information is asynchronous and unidirectional. 21 // HTML UI. State information is asynchronous and unidirectional.
20 class UiInterface { 22 class UiInterface {
21 public: 23 public:
22 enum Mode { 24 enum Mode {
23 STANDARD, 25 STANDARD,
24 WEB_VR, 26 WEB_VR,
25 }; 27 };
26 28
27 UiInterface(); 29 UiInterface();
28 virtual ~UiInterface(); 30 virtual ~UiInterface();
29 31
30 void SetMode(Mode mode); 32 void SetMode(Mode mode);
31 void SetSecureOrigin(bool secure); 33 void SetSecureOrigin(bool secure);
34 void SetLoading(bool loading);
35 void SetURL(const GURL& url);
32 36
33 // Called by WebUI when starting VR. 37 // Called by WebUI when starting VR.
34 void OnDomContentsLoaded(); 38 void OnDomContentsLoaded();
35 void SetUiCommandHandler(UiCommandHandler* handler); 39 void SetUiCommandHandler(UiCommandHandler* handler);
36 40
37 private: 41 private:
38 void FlushUpdates(); 42 void FlushUpdates();
39 43
40 UiCommandHandler* handler_; 44 UiCommandHandler* handler_;
41 bool loaded_ = false; 45 bool loaded_ = false;
42 base::DictionaryValue updates_; 46 base::DictionaryValue updates_;
43 47
44 DISALLOW_COPY_AND_ASSIGN(UiInterface); 48 DISALLOW_COPY_AND_ASSIGN(UiInterface);
45 }; 49 };
46 50
47 } // namespace vr_shell 51 } // namespace vr_shell
48 52
49 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_ 53 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_INTERFACE_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/ui_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698