Commit f47c6e53 authored by Christopher Grant's avatar Christopher Grant Committed by Commit Bot

VR: Make the common, UI and base portions of VR separate components

This change cleans up some baggage left over from the original splitting of UI out
of the common VR codebase, and makes native module work easier.

BUG=

Change-Id: I6c2935a4986023963a2cbc9535a97858016c30c9
Reviewed-on: https://chromium-review.googlesource.com/c/1393463Reviewed-by: default avatarIan Vollick <vollick@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619473}
parent bcff4822
...@@ -197,10 +197,7 @@ component("vr_ui") { ...@@ -197,10 +197,7 @@ component("vr_ui") {
"//skia", "//skia",
] ]
defines = [ defines = [ "VR_UI_IMPLEMENTATION" ]
"VR_IMPLEMENTATION",
"VR_UI_IMPLEMENTATION",
]
if (use_command_buffer) { if (use_command_buffer) {
sources += [ sources += [
...@@ -258,6 +255,7 @@ component("vr_common") { ...@@ -258,6 +255,7 @@ component("vr_common") {
"sounds_manager_audio_delegate.h", "sounds_manager_audio_delegate.h",
"ui_factory.cc", "ui_factory.cc",
"ui_factory.h", "ui_factory.h",
"vr_export.h",
"vr_web_contents_observer.cc", "vr_web_contents_observer.cc",
"vr_web_contents_observer.h", "vr_web_contents_observer.h",
] ]
...@@ -317,10 +315,7 @@ component("vr_common") { ...@@ -317,10 +315,7 @@ component("vr_common") {
deps += [ "//services/ws/public/cpp/gpu" ] deps += [ "//services/ws/public/cpp/gpu" ]
} }
defines = [ defines = [ "VR_IMPLEMENTATION" ]
"VR_IMPLEMENTATION",
"VR_UI_IMPLEMENTATION",
]
if (!use_command_buffer) { if (!use_command_buffer) {
sources += [ sources += [
...@@ -333,7 +328,7 @@ component("vr_common") { ...@@ -333,7 +328,7 @@ component("vr_common") {
# vr_base contains common dependencies of vr_common and vr_ui. It exists because # vr_base contains common dependencies of vr_common and vr_ui. It exists because
# vr_ui must not depend on vr_common. # vr_ui must not depend on vr_common.
source_set("vr_base") { component("vr_base") {
sources = [ sources = [
"assets_component_update_status.h", "assets_component_update_status.h",
"assets_load_status.h", "assets_load_status.h",
...@@ -392,7 +387,7 @@ source_set("vr_base") { ...@@ -392,7 +387,7 @@ source_set("vr_base") {
"ui_support.h", "ui_support.h",
"ui_test_input.h", "ui_test_input.h",
"ui_unsupported_mode.h", "ui_unsupported_mode.h",
"vr_export.h", "vr_base_export.h",
"vr_geometry_util.cc", "vr_geometry_util.cc",
"vr_geometry_util.h", "vr_geometry_util.h",
"vr_gl_util.cc", "vr_gl_util.cc",
...@@ -404,10 +399,7 @@ source_set("vr_base") { ...@@ -404,10 +399,7 @@ source_set("vr_base") {
"keyboard_delegate_for_testing.h", "keyboard_delegate_for_testing.h",
] ]
defines = [ defines = [ "VR_BASE_IMPLEMENTATION" ]
"VR_IMPLEMENTATION",
"VR_UI_IMPLEMENTATION",
]
public_deps = [ public_deps = [
":vr_build_features", ":vr_build_features",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/version.h" #include "base/version.h"
#include "chrome/browser/vr/assets_load_status.h" #include "chrome/browser/vr/assets_load_status.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace base { namespace base {
class DictionaryValue; class DictionaryValue;
...@@ -40,7 +40,7 @@ struct Assets; ...@@ -40,7 +40,7 @@ struct Assets;
// component will be made available on a different thread than the asset load // component will be made available on a different thread than the asset load
// request. Internally, the function calls will be posted on the main thread. // request. Internally, the function calls will be posted on the main thread.
// The asset load may be performed on a worker thread. // The asset load may be performed on a worker thread.
class VR_EXPORT AssetsLoader { class VR_BASE_EXPORT AssetsLoader {
public: public:
typedef base::OnceCallback<void(AssetsLoadStatus status, typedef base::OnceCallback<void(AssetsLoadStatus status,
std::unique_ptr<Assets> assets, std::unique_ptr<Assets> assets,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "chrome/browser/vr/model/capturing_state_model.h" #include "chrome/browser/vr/model/capturing_state_model.h"
#include "chrome/browser/vr/model/web_vr_model.h" #include "chrome/browser/vr/model/web_vr_model.h"
#include "chrome/browser/vr/ui_unsupported_mode.h" #include "chrome/browser/vr/ui_unsupported_mode.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "components/security_state/core/security_state.h" #include "components/security_state/core/security_state.h"
namespace base { namespace base {
...@@ -28,7 +28,7 @@ struct LocationBarState; ...@@ -28,7 +28,7 @@ struct LocationBarState;
// The browser communicates state changes to the VR UI via this interface. // The browser communicates state changes to the VR UI via this interface.
// A GL thread would also implement this interface to provide a convenient way // A GL thread would also implement this interface to provide a convenient way
// to call these methods from the main thread. // to call these methods from the main thread.
class VR_EXPORT BrowserUiInterface { class VR_BASE_EXPORT BrowserUiInterface {
public: public:
virtual ~BrowserUiInterface() {} virtual ~BrowserUiInterface() {}
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <utility> #include <utility>
#include "chrome/browser/vr/gl_texture_location.h" #include "chrome/browser/vr/gl_texture_location.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
#define CHROME_BROWSER_VR_INPUT_EVENT_H_ #define CHROME_BROWSER_VR_INPUT_EVENT_H_
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/point_f.h"
namespace vr { namespace vr {
class VR_EXPORT InputEvent { class VR_BASE_EXPORT InputEvent {
public: public:
enum Type { enum Type {
kTypeUndefined = -1, kTypeUndefined = -1,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define CHROME_BROWSER_VR_KEYBOARD_DELEGATE_H_ #define CHROME_BROWSER_VR_KEYBOARD_DELEGATE_H_
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace gfx { namespace gfx {
class Point3F; class Point3F;
...@@ -20,7 +20,7 @@ class KeyboardUiInterface; ...@@ -20,7 +20,7 @@ class KeyboardUiInterface;
struct CameraModel; struct CameraModel;
struct TextInputInfo; struct TextInputInfo;
class VR_EXPORT KeyboardDelegate { class VR_BASE_EXPORT KeyboardDelegate {
public: public:
virtual ~KeyboardDelegate() {} virtual ~KeyboardDelegate() {}
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "chrome/browser/vr/keyboard_delegate.h" #include "chrome/browser/vr/keyboard_delegate.h"
#include "chrome/browser/vr/model/text_input_info.h" #include "chrome/browser/vr/model/text_input_info.h"
#include "chrome/browser/vr/ui_test_input.h" #include "chrome/browser/vr/ui_test_input.h"
#include "chrome/browser/vr/vr_base_export.h"
namespace gfx { namespace gfx {
class Point3F; class Point3F;
...@@ -22,7 +23,7 @@ namespace vr { ...@@ -22,7 +23,7 @@ namespace vr {
class KeyboardUiInterface; class KeyboardUiInterface;
struct CameraModel; struct CameraModel;
class KeyboardDelegateForTesting : public KeyboardDelegate { class VR_BASE_EXPORT KeyboardDelegateForTesting : public KeyboardDelegate {
public: public:
KeyboardDelegateForTesting(); KeyboardDelegateForTesting();
~KeyboardDelegateForTesting() override; ~KeyboardDelegateForTesting() override;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define CHROME_BROWSER_VR_KEYBOARD_UI_INTERFACE_H_ #define CHROME_BROWSER_VR_KEYBOARD_UI_INTERFACE_H_
#include "chrome/browser/vr/model/text_input_info.h" #include "chrome/browser/vr/model/text_input_info.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
...@@ -14,7 +14,7 @@ namespace vr { ...@@ -14,7 +14,7 @@ namespace vr {
// that we have this interface to restrict the UI API to keyboard-specific // that we have this interface to restrict the UI API to keyboard-specific
// callback functions because the keyboard delegate doesn't need access to all // callback functions because the keyboard delegate doesn't need access to all
// of the UI. // of the UI.
class VR_EXPORT KeyboardUiInterface { class VR_BASE_EXPORT KeyboardUiInterface {
public: public:
virtual ~KeyboardUiInterface() {} virtual ~KeyboardUiInterface() {}
virtual void OnInputEdited(const EditedText& info) = 0; virtual void OnInputEdited(const EditedText& info) = 0;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "chrome/browser/vr/assets_component_update_status.h" #include "chrome/browser/vr/assets_component_update_status.h"
#include "chrome/browser/vr/assets_load_status.h" #include "chrome/browser/vr/assets_load_status.h"
#include "chrome/browser/vr/mode.h" #include "chrome/browser/vr/mode.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace base { namespace base {
class Version; class Version;
...@@ -24,7 +24,7 @@ namespace vr { ...@@ -24,7 +24,7 @@ namespace vr {
// Helper to collect VR UMA metrics. // Helper to collect VR UMA metrics.
// //
// For thread-safety, all functions must be called in sequence. // For thread-safety, all functions must be called in sequence.
class VR_EXPORT MetricsHelper { class VR_BASE_EXPORT MetricsHelper {
public: public:
MetricsHelper(); MetricsHelper();
~MetricsHelper(); ~MetricsHelper();
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/vr/mode.h" #include "chrome/browser/vr/mode.h"
#include "chrome/browser/vr/ui_browser_interface.h" #include "chrome/browser/vr/ui_browser_interface.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_source_id.h" #include "services/metrics/public/cpp/ukm_source_id.h"
...@@ -147,7 +147,8 @@ class SessionTracker { ...@@ -147,7 +147,8 @@ class SessionTracker {
// metrics that require state monitoring, such as durations, but also tracks // metrics that require state monitoring, such as durations, but also tracks
// data we want attached to that, such as number of videos watched and how the // data we want attached to that, such as number of videos watched and how the
// session was started. // session was started.
class VR_EXPORT SessionMetricsHelper : public content::WebContentsObserver { class VR_BASE_EXPORT SessionMetricsHelper
: public content::WebContentsObserver {
public: public:
// Returns the SessionMetricsHelper singleton if it has been created for the // Returns the SessionMetricsHelper singleton if it has been created for the
// WebContents. // WebContents.
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
#include <memory> #include <memory>
#include "base/version.h" #include "base/version.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
class SkBitmap; class SkBitmap;
namespace vr { namespace vr {
struct VR_EXPORT Assets { struct VR_BASE_EXPORT Assets {
Assets(); Assets();
~Assets(); ~Assets();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_MODEL_CAMERA_MODEL_H_ #ifndef CHROME_BROWSER_VR_MODEL_CAMERA_MODEL_H_
#define CHROME_BROWSER_VR_MODEL_CAMERA_MODEL_H_ #define CHROME_BROWSER_VR_MODEL_CAMERA_MODEL_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/transform.h" #include "ui/gfx/transform.h"
...@@ -17,7 +17,7 @@ enum EyeType { ...@@ -17,7 +17,7 @@ enum EyeType {
kRightEye, kRightEye,
}; };
struct VR_EXPORT CameraModel { struct VR_BASE_EXPORT CameraModel {
EyeType eye_type; EyeType eye_type;
gfx::Rect viewport; gfx::Rect viewport;
gfx::Transform view_matrix; gfx::Transform view_matrix;
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
#ifndef CHROME_BROWSER_VR_MODEL_CAPTURING_STATE_MODEL_H_ #ifndef CHROME_BROWSER_VR_MODEL_CAPTURING_STATE_MODEL_H_
#define CHROME_BROWSER_VR_MODEL_CAPTURING_STATE_MODEL_H_ #define CHROME_BROWSER_VR_MODEL_CAPTURING_STATE_MODEL_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
struct VR_EXPORT CapturingStateModel { struct VR_BASE_EXPORT CapturingStateModel {
bool audio_capture_enabled = false; bool audio_capture_enabled = false;
bool video_capture_enabled = false; bool video_capture_enabled = false;
bool screen_capture_enabled = false; bool screen_capture_enabled = false;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define CHROME_BROWSER_VR_MODEL_CONTROLLER_MODEL_H_ #define CHROME_BROWSER_VR_MODEL_CONTROLLER_MODEL_H_
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/point3_f.h" #include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/transform.h" #include "ui/gfx/transform.h"
...@@ -16,7 +16,7 @@ namespace vr { ...@@ -16,7 +16,7 @@ namespace vr {
// platform-specific VR subsystem (e.g., GVR). It is used by both the // platform-specific VR subsystem (e.g., GVR). It is used by both the
// UiInputManager (for generating gestures), and by the UI for rendering the // UiInputManager (for generating gestures), and by the UI for rendering the
// controller. // controller.
struct VR_EXPORT ControllerModel { struct VR_BASE_EXPORT ControllerModel {
enum ButtonState { enum ButtonState {
kUp, kUp,
kDown, kDown,
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
#define CHROME_BROWSER_VR_MODEL_HOSTED_PLATFORM_UI_H_ #define CHROME_BROWSER_VR_MODEL_HOSTED_PLATFORM_UI_H_
#include "chrome/browser/vr/platform_ui_input_delegate.h" #include "chrome/browser/vr/platform_ui_input_delegate.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/geometry/rect_f.h"
namespace vr { namespace vr {
typedef PlatformUiInputDelegate* PlatformUiInputDelegatePtr; typedef PlatformUiInputDelegate* PlatformUiInputDelegatePtr;
struct VR_EXPORT HostedPlatformUi { struct VR_BASE_EXPORT HostedPlatformUi {
bool hosted_ui_enabled = false; bool hosted_ui_enabled = false;
PlatformUiInputDelegatePtr delegate = nullptr; PlatformUiInputDelegatePtr delegate = nullptr;
unsigned int texture_id = 0; unsigned int texture_id = 0;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_ #ifndef CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_
#define CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_ #define CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "components/security_state/core/security_state.h" #include "components/security_state/core/security_state.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -16,7 +16,7 @@ struct VectorIcon; ...@@ -16,7 +16,7 @@ struct VectorIcon;
namespace vr { namespace vr {
// Passes information obtained from LocationBarModel to the VR UI framework. // Passes information obtained from LocationBarModel to the VR UI framework.
struct VR_EXPORT LocationBarState { struct VR_BASE_EXPORT LocationBarState {
public: public:
LocationBarState(); LocationBarState();
LocationBarState(const GURL& url, LocationBarState(const GURL& url,
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
#define CHROME_BROWSER_VR_MODEL_OMNIBOX_SUGGESTIONS_H_ #define CHROME_BROWSER_VR_MODEL_OMNIBOX_SUGGESTIONS_H_
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/autocomplete_match.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace vr { namespace vr {
struct VR_EXPORT Autocompletion { struct VR_BASE_EXPORT Autocompletion {
Autocompletion(); Autocompletion();
Autocompletion(const base::string16& new_input, Autocompletion(const base::string16& new_input,
const base::string16& new_suffix); const base::string16& new_suffix);
...@@ -28,7 +28,7 @@ struct VR_EXPORT Autocompletion { ...@@ -28,7 +28,7 @@ struct VR_EXPORT Autocompletion {
base::string16 suffix; base::string16 suffix;
}; };
struct VR_EXPORT OmniboxSuggestion { struct VR_BASE_EXPORT OmniboxSuggestion {
OmniboxSuggestion(); OmniboxSuggestion();
OmniboxSuggestion(const base::string16& new_contents, OmniboxSuggestion(const base::string16& new_contents,
...@@ -53,7 +53,7 @@ struct VR_EXPORT OmniboxSuggestion { ...@@ -53,7 +53,7 @@ struct VR_EXPORT OmniboxSuggestion {
Autocompletion autocompletion; Autocompletion autocompletion;
}; };
struct VR_EXPORT OmniboxSuggestions { struct VR_BASE_EXPORT OmniboxSuggestions {
OmniboxSuggestions(); OmniboxSuggestions();
~OmniboxSuggestions(); ~OmniboxSuggestions();
...@@ -62,7 +62,7 @@ struct VR_EXPORT OmniboxSuggestions { ...@@ -62,7 +62,7 @@ struct VR_EXPORT OmniboxSuggestions {
// This struct contains the minimal set of information required to construct an // This struct contains the minimal set of information required to construct an
// AutocompleteInput on VR's behalf. // AutocompleteInput on VR's behalf.
struct VR_EXPORT AutocompleteRequest { struct VR_BASE_EXPORT AutocompleteRequest {
base::string16 text; base::string16 text;
size_t cursor_position = 0; size_t cursor_position = 0;
bool prevent_inline_autocomplete = false; bool prevent_inline_autocomplete = false;
...@@ -77,7 +77,7 @@ struct VR_EXPORT AutocompleteRequest { ...@@ -77,7 +77,7 @@ struct VR_EXPORT AutocompleteRequest {
}; };
// This struct represents the current request to the AutocompleteController. // This struct represents the current request to the AutocompleteController.
struct VR_EXPORT AutocompleteStatus { struct VR_BASE_EXPORT AutocompleteStatus {
bool active = false; bool active = false;
base::string16 input; base::string16 input;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_MODEL_RETICLE_MODEL_H_ #ifndef CHROME_BROWSER_VR_MODEL_RETICLE_MODEL_H_
#define CHROME_BROWSER_VR_MODEL_RETICLE_MODEL_H_ #define CHROME_BROWSER_VR_MODEL_RETICLE_MODEL_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/point3_f.h" #include "ui/gfx/geometry/point3_f.h"
namespace vr { namespace vr {
...@@ -19,7 +19,7 @@ enum CursorType { ...@@ -19,7 +19,7 @@ enum CursorType {
// controller's laser. It is computed by the UiInputManager and is used by the // controller's laser. It is computed by the UiInputManager and is used by the
// input manager in the production of gestures as well as by the Reticle element // input manager in the production of gestures as well as by the Reticle element
// in the scene. // in the scene.
struct VR_EXPORT ReticleModel { struct VR_BASE_EXPORT ReticleModel {
gfx::Point3F target_point; gfx::Point3F target_point;
gfx::PointF target_local_point; gfx::PointF target_local_point;
int target_element_id = 0; int target_element_id = 0;
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
#define CHROME_BROWSER_VR_MODEL_SPEECH_RECOGNITION_MODEL_H_ #define CHROME_BROWSER_VR_MODEL_SPEECH_RECOGNITION_MODEL_H_
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
struct VR_EXPORT SpeechRecognitionModel { struct VR_BASE_EXPORT SpeechRecognitionModel {
int speech_recognition_state = 0; int speech_recognition_state = 0;
bool has_or_can_request_audio_permission = true; bool has_or_can_request_audio_permission = true;
base::string16 recognition_result; base::string16 recognition_result;
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/vr/text_edit_action.h" #include "chrome/browser/vr/text_edit_action.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
// Represents the state of an editable text field. // Represents the state of an editable text field.
struct VR_EXPORT TextInputInfo { struct VR_BASE_EXPORT TextInputInfo {
public: public:
TextInputInfo(); TextInputInfo();
explicit TextInputInfo(base::string16 t); explicit TextInputInfo(base::string16 t);
...@@ -65,7 +65,7 @@ struct VR_EXPORT TextInputInfo { ...@@ -65,7 +65,7 @@ struct VR_EXPORT TextInputInfo {
// A superset of TextInputInfo, consisting of a current and previous text field // A superset of TextInputInfo, consisting of a current and previous text field
// state. A keyboard can return this structure, allowing clients to derive // state. A keyboard can return this structure, allowing clients to derive
// deltas in keyboard state. // deltas in keyboard state.
struct VR_EXPORT EditedText { struct VR_BASE_EXPORT EditedText {
public: public:
EditedText(); EditedText();
EditedText(const EditedText& other); EditedText(const EditedText& other);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_MODEL_WEB_VR_MODEL_H_ #ifndef CHROME_BROWSER_VR_MODEL_WEB_VR_MODEL_H_
#define CHROME_BROWSER_VR_MODEL_WEB_VR_MODEL_H_ #define CHROME_BROWSER_VR_MODEL_WEB_VR_MODEL_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
...@@ -35,7 +35,7 @@ enum class ExternalPromptNotificationType { ...@@ -35,7 +35,7 @@ enum class ExternalPromptNotificationType {
kPromptBluetooth, kPromptBluetooth,
}; };
struct VR_EXPORT WebVrModel { struct VR_BASE_EXPORT WebVrModel {
WebVrState state = kWebVrNoTimeoutPending; WebVrState state = kWebVrNoTimeoutPending;
bool has_received_permissions = false; bool has_received_permissions = false;
bool showing_hosted_ui = false; bool showing_hosted_ui = false;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "chrome/browser/vr/macros.h" #include "chrome/browser/vr/macros.h"
#include "chrome/browser/vr/model/text_input_info.h" #include "chrome/browser/vr/model/text_input_info.h"
#include "chrome/browser/vr/text_edit_action.h" #include "chrome/browser/vr/text_edit_action.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
namespace base { namespace base {
...@@ -32,7 +32,7 @@ class PlatformInputHandler; ...@@ -32,7 +32,7 @@ class PlatformInputHandler;
// This class is responsible for processing all events and gestures for // This class is responsible for processing all events and gestures for
// PlatformUiElement. // PlatformUiElement.
class VR_EXPORT PlatformUiInputDelegate { class VR_BASE_EXPORT PlatformUiInputDelegate {
public: public:
PlatformUiInputDelegate(); PlatformUiInputDelegate();
explicit PlatformUiInputDelegate(PlatformInputHandler* input_handler); explicit PlatformUiInputDelegate(PlatformInputHandler* input_handler);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_POSE_UTIL_H_ #ifndef CHROME_BROWSER_VR_POSE_UTIL_H_
#define CHROME_BROWSER_VR_POSE_UTIL_H_ #define CHROME_BROWSER_VR_POSE_UTIL_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/vector3d_f.h" #include "ui/gfx/geometry/vector3d_f.h"
namespace gfx { namespace gfx {
...@@ -15,10 +15,10 @@ class Transform; ...@@ -15,10 +15,10 @@ class Transform;
namespace vr { namespace vr {
// Provides the direction the head is looking towards as a 3x1 unit vector. // Provides the direction the head is looking towards as a 3x1 unit vector.
VR_EXPORT gfx::Vector3dF GetForwardVector(const gfx::Transform& head_pose); VR_BASE_EXPORT gfx::Vector3dF GetForwardVector(const gfx::Transform& head_pose);
// Returns a vector heading upward from the viewer's head. // Returns a vector heading upward from the viewer's head.
VR_EXPORT gfx::Vector3dF GetUpVector(const gfx::Transform& head_pose); VR_BASE_EXPORT gfx::Vector3dF GetUpVector(const gfx::Transform& head_pose);
} // namespace vr } // namespace vr
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
#define CHROME_BROWSER_VR_RENDER_INFO_H_ #define CHROME_BROWSER_VR_RENDER_INFO_H_
#include "chrome/browser/vr/model/camera_model.h" #include "chrome/browser/vr/model/camera_model.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/transform.h" #include "ui/gfx/transform.h"
namespace vr { namespace vr {
// Provides information for rendering such as the viewport and view/projection // Provides information for rendering such as the viewport and view/projection
// matrix. // matrix.
struct VR_EXPORT RenderInfo { struct VR_BASE_EXPORT RenderInfo {
gfx::Transform head_pose; gfx::Transform head_pose;
CameraModel left_eye_model; CameraModel left_eye_model;
CameraModel right_eye_model; CameraModel right_eye_model;
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
#include <utility> #include <utility>
#include "chrome/browser/vr/gl_texture_location.h" #include "chrome/browser/vr/gl_texture_location.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
class VR_EXPORT SchedulerUiInterface { class VR_BASE_EXPORT SchedulerUiInterface {
public: public:
virtual ~SchedulerUiInterface() {} virtual ~SchedulerUiInterface() {}
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace content { namespace content {
class SpeechRecognitionManager; class SpeechRecognitionManager;
...@@ -90,7 +90,7 @@ class IOBrowserUIInterface { ...@@ -90,7 +90,7 @@ class IOBrowserUIInterface {
// SpeechRecognizer is a wrapper around the speech recognition engine that // SpeechRecognizer is a wrapper around the speech recognition engine that
// simplifies its use from the UI thread. This class handles all setup/shutdown, // simplifies its use from the UI thread. This class handles all setup/shutdown,
// collection of results, error cases, and threading. // collection of results, error cases, and threading.
class VR_EXPORT SpeechRecognizer : public IOBrowserUIInterface { class VR_BASE_EXPORT SpeechRecognizer : public IOBrowserUIInterface {
public: public:
// |shared_url_loader_factory_info| must be for a creating a // |shared_url_loader_factory_info| must be for a creating a
// SharedURLLoaderFactory that can be used on the IO Thread. // SharedURLLoaderFactory that can be used on the IO Thread.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <vector> #include <vector>
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
...@@ -20,7 +20,7 @@ enum TextEditActionType { ...@@ -20,7 +20,7 @@ enum TextEditActionType {
DELETE_TEXT, DELETE_TEXT,
}; };
class VR_EXPORT TextEditAction { class VR_BASE_EXPORT TextEditAction {
public: public:
explicit TextEditAction(TextEditActionType type); explicit TextEditAction(TextEditActionType type);
TextEditAction(TextEditActionType type, TextEditAction(TextEditActionType type,
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
struct TextInputInfo; struct TextInputInfo;
class VR_EXPORT TextInputDelegate { class VR_BASE_EXPORT TextInputDelegate {
public: public:
TextInputDelegate(); TextInputDelegate();
virtual ~TextInputDelegate(); virtual ~TextInputDelegate();
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "chrome/browser/vr/exit_vr_prompt_choice.h" #include "chrome/browser/vr/exit_vr_prompt_choice.h"
#include "chrome/browser/vr/model/omnibox_suggestions.h" #include "chrome/browser/vr/model/omnibox_suggestions.h"
#include "chrome/browser/vr/ui_unsupported_mode.h" #include "chrome/browser/vr/ui_unsupported_mode.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/size_f.h" #include "ui/gfx/geometry/size_f.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -23,7 +23,7 @@ enum NavigationMethod { ...@@ -23,7 +23,7 @@ enum NavigationMethod {
// An interface for the VR UI to communicate with VrShell. Many of the functions // An interface for the VR UI to communicate with VrShell. Many of the functions
// in this interface are proxies to methods on VrShell. // in this interface are proxies to methods on VrShell.
class VR_EXPORT UiBrowserInterface { class VR_BASE_EXPORT UiBrowserInterface {
public: public:
virtual ~UiBrowserInterface() = default; virtual ~UiBrowserInterface() = default;
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
#ifndef CHROME_BROWSER_VR_UI_INITIAL_STATE_H_ #ifndef CHROME_BROWSER_VR_UI_INITIAL_STATE_H_
#define CHROME_BROWSER_VR_UI_INITIAL_STATE_H_ #define CHROME_BROWSER_VR_UI_INITIAL_STATE_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
namespace vr { namespace vr {
// This class describes the initial state of a UI, and may be used by a UI // This class describes the initial state of a UI, and may be used by a UI
// instances owner to specify a custom state on startup. // instances owner to specify a custom state on startup.
struct VR_EXPORT UiInitialState { struct VR_BASE_EXPORT UiInitialState {
UiInitialState(); UiInitialState();
UiInitialState(const UiInitialState& other); UiInitialState(const UiInitialState& other);
bool in_web_vr = false; bool in_web_vr = false;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_UI_SUPPORT_H_ #ifndef CHROME_BROWSER_VR_UI_SUPPORT_H_
#define CHROME_BROWSER_VR_UI_SUPPORT_H_ #define CHROME_BROWSER_VR_UI_SUPPORT_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "components/url_formatter/url_formatter.h" #include "components/url_formatter/url_formatter.h"
#include "third_party/icu/source/common/unicode/uchar.h" #include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/uscript.h" #include "third_party/icu/source/common/unicode/uscript.h"
...@@ -20,10 +20,10 @@ namespace vr { ...@@ -20,10 +20,10 @@ namespace vr {
// must supply wrappers for use by the module. For libraries that require only // must supply wrappers for use by the module. For libraries that require only
// one or two methods, it's more efficient to make wrappers. // one or two methods, it's more efficient to make wrappers.
VR_EXPORT UScriptCode UScriptGetScript(UChar32 codepoint, UErrorCode* err); VR_BASE_EXPORT UScriptCode UScriptGetScript(UChar32 codepoint, UErrorCode* err);
VR_EXPORT base::string16 FormatUrlForVr(const GURL& gurl, VR_BASE_EXPORT base::string16 FormatUrlForVr(const GURL& gurl,
url::Parsed* new_parsed); url::Parsed* new_parsed);
} // namespace vr } // namespace vr
......
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_VR_VR_BASE_EXPORT_H_
#define CHROME_BROWSER_VR_VR_BASE_EXPORT_H_
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(VR_BASE_IMPLEMENTATION)
#define VR_BASE_EXPORT __declspec(dllexport)
#else
#define VR_BASE_EXPORT __declspec(dllimport)
#endif // defined(VR_BASE_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(VR_BASE_IMPLEMENTATION)
#define VR_BASE_EXPORT __attribute__((visibility("default")))
#else
#define VR_BASE_EXPORT
#endif // defined(VR_BASE_IMPLEMENTATION)
#endif
#else // defined(COMPONENT_BUILD)
#define VR_BASE_EXPORT
#endif
#endif // CHROME_BROWSER_VR_VR_BASE_EXPORT_H_
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VR_VR_GEOMETRY_UTIL_H_ #ifndef CHROME_BROWSER_VR_VR_GEOMETRY_UTIL_H_
#define CHROME_BROWSER_VR_VR_GEOMETRY_UTIL_H_ #define CHROME_BROWSER_VR_VR_GEOMETRY_UTIL_H_
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
namespace gfx { namespace gfx {
...@@ -17,14 +17,15 @@ class Transform; ...@@ -17,14 +17,15 @@ class Transform;
namespace vr { namespace vr {
VR_EXPORT gfx::Rect CalculatePixelSpaceRect(const gfx::Size& texture_size, VR_BASE_EXPORT gfx::Rect CalculatePixelSpaceRect(
const gfx::RectF& texture_rect); const gfx::Size& texture_size,
const gfx::RectF& texture_rect);
// Returns the normalized size of the element projected into screen space. // Returns the normalized size of the element projected into screen space.
// If (1, 1) the element fills the entire buffer. // If (1, 1) the element fills the entire buffer.
VR_EXPORT gfx::SizeF CalculateScreenSize(const gfx::Transform& proj_matrix, VR_BASE_EXPORT gfx::SizeF CalculateScreenSize(const gfx::Transform& proj_matrix,
float distance, float distance,
const gfx::SizeF& size); const gfx::SizeF& size);
} // namespace vr } // namespace vr
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <string> #include <string>
#include "chrome/browser/vr/gl_bindings.h" #include "chrome/browser/vr/gl_bindings.h"
#include "chrome/browser/vr/vr_export.h" #include "chrome/browser/vr/vr_base_export.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#define SHADER(Src) "#version 100\n" #Src #define SHADER(Src) "#version 100\n" #Src
...@@ -23,27 +23,28 @@ class Transform; ...@@ -23,27 +23,28 @@ class Transform;
namespace vr { namespace vr {
VR_EXPORT std::array<float, 16> MatrixToGLArray(const gfx::Transform& matrix); VR_BASE_EXPORT std::array<float, 16> MatrixToGLArray(
const gfx::Transform& matrix);
// Compile a shader. // Compile a shader.
VR_EXPORT GLuint CompileShader(GLenum shader_type, VR_BASE_EXPORT GLuint CompileShader(GLenum shader_type,
const GLchar* shader_source, const GLchar* shader_source,
std::string& error); std::string& error);
// Compile and link a program. // Compile and link a program.
VR_EXPORT GLuint CreateAndLinkProgram(GLuint vertex_shader_handle, VR_BASE_EXPORT GLuint CreateAndLinkProgram(GLuint vertex_shader_handle,
GLuint fragment_shader_handle, GLuint fragment_shader_handle,
std::string& error); std::string& error);
// Sets default texture parameters given a texture type. // Sets default texture parameters given a texture type.
VR_EXPORT void SetTexParameters(GLenum texture_type); VR_BASE_EXPORT void SetTexParameters(GLenum texture_type);
// Sets color uniforms given an SkColor. // Sets color uniforms given an SkColor.
VR_EXPORT void SetColorUniform(GLuint handle, SkColor c); VR_BASE_EXPORT void SetColorUniform(GLuint handle, SkColor c);
// Sets color uniforms (but not alpha) given an SkColor. The alpha is assumed to // Sets color uniforms (but not alpha) given an SkColor. The alpha is assumed to
// be 1.0 in this case. // be 1.0 in this case.
VR_EXPORT void SetOpaqueColorUniform(GLuint handle, SkColor c); VR_BASE_EXPORT void SetOpaqueColorUniform(GLuint handle, SkColor c);
} // namespace vr } // namespace vr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment