diff options
author | Paul Rouget <me@paulrouget.com> | 2020-08-10 15:23:05 +0200 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2020-08-10 15:58:24 +0200 |
commit | 47fde310b15dbec58c0fac1ee452c6059367fd5c (patch) | |
tree | dcdccf0a4161a74ffa6f3ea148731f81ba69a49e | |
parent | 0275afdfb48738ccb20ff1850f2b05ef3c2c3786 (diff) | |
download | servo-47fde310b15dbec58c0fac1ee452c6059367fd5c.tar.gz servo-47fde310b15dbec58c0fac1ee452c6059367fd5c.zip |
UWP: Bookmarks
-rw-r--r-- | support/hololens/ServoApp/Bookmarks.cpp | 100 | ||||
-rw-r--r-- | support/hololens/ServoApp/Bookmarks.h | 38 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.cpp | 95 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.h | 44 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.idl | 8 | ||||
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.xaml | 53 | ||||
-rw-r--r-- | support/hololens/ServoApp/Resources/Strings/en-US/Resources.resw | 84 | ||||
-rw-r--r-- | support/hololens/ServoApp/ServoApp.vcxproj | 2 | ||||
-rw-r--r-- | support/hololens/ServoApp/ServoApp.vcxproj.filters | 4 | ||||
-rw-r--r-- | support/hololens/ServoApp/ServoControl/ServoControl.h | 2 |
10 files changed, 374 insertions, 56 deletions
diff --git a/support/hololens/ServoApp/Bookmarks.cpp b/support/hololens/ServoApp/Bookmarks.cpp new file mode 100644 index 00000000000..a421dfe6ed6 --- /dev/null +++ b/support/hololens/ServoApp/Bookmarks.cpp @@ -0,0 +1,100 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "pch.h" +#include "Bookmarks.h" + +namespace winrt::servo { + +using namespace Windows::Storage; +using namespace Windows::UI::Core; +using namespace Windows::Foundation; +using namespace Windows::Data::Json; +using namespace Windows::ApplicationModel::Core; + +Bookmarks::Bookmarks() { + db = winrt::single_threaded_observable_vector<IInspectable>(); + auto x = Concurrency::create_task([=] { + auto storageFolder = ApplicationData::Current().LocalFolder(); + auto bm_file = storageFolder.GetFileAsync(L"bookmarks.json").get(); + bool file_exist = + storageFolder.TryGetItemAsync(L"bookmarks.json").get() != nullptr; + if (file_exist) { + auto content = FileIO::ReadTextAsync(bm_file).get(); + JsonValue out = JsonValue::Parse(L"[]"); + if (!JsonValue::TryParse(content, out)) { + return; + } + auto list = out.GetArray(); + std::vector<IInspectable> bookmarks; + for (auto value : list) { + auto obj = value.GetObject(); + auto name = obj.GetNamedString(L"name"); + auto url = obj.GetNamedString(L"url"); + bookmarks.push_back(box_value(ServoApp::Bookmark(url, name))); + } + auto dispatcher = CoreApplication::MainView().CoreWindow().Dispatcher(); + dispatcher.RunAsync(CoreDispatcherPriority::High, [=] { + db.ReplaceAll(bookmarks); + BuildIndex(); + }); + } + }); +} + +bool Bookmarks::Contains(const hstring &url) { return mIndex.count(url) > 0; } + +void Bookmarks::Set(hstring url, hstring title) { + auto bm = box_value(ServoApp::Bookmark(url, title)); + if (Contains(url)) { + auto index = mIndex.at(url); + db.SetAt(index, bm); + } else { + db.Append(bm); + } + InvalidateDB(); +} + +hstring Bookmarks::GetName(const hstring &url) { + auto index = mIndex.at(url); + ServoApp::Bookmark bm = unbox_value<ServoApp::Bookmark>(db.GetAt(index)); + return bm.Name(); +} + +void Bookmarks::Delete(const hstring &url) { + auto index = mIndex.at(url); + db.RemoveAt(index); + InvalidateDB(); +} + +void Bookmarks::BuildIndex() { + mIndex.clear(); + int i = 0; + for (auto bm : db) { + auto url = unbox_value<ServoApp::Bookmark>(bm).Url(); + mIndex.insert_or_assign(url, i++); + } +} + +void Bookmarks::InvalidateDB() { + BuildIndex(); + WriteSettings(); +} + +IAsyncAction Bookmarks::WriteSettings() { + auto storageFolder = ApplicationData::Current().LocalFolder(); + auto file = co_await storageFolder.CreateFileAsync( + L"bookmarks.json", CreationCollisionOption::ReplaceExisting); + JsonArray list; + for (auto boxed_bm : db) { + auto bm = unbox_value<ServoApp::Bookmark>(boxed_bm); + JsonObject bookmark; + bookmark.Insert(L"name", JsonValue::CreateStringValue(bm.Name())); + bookmark.Insert(L"url", JsonValue::CreateStringValue(bm.Url())); + list.Append(bookmark); + } + FileIO::WriteTextAsync(file, list.Stringify()); +} + +} // namespace winrt::servo diff --git a/support/hololens/ServoApp/Bookmarks.h b/support/hololens/ServoApp/Bookmarks.h new file mode 100644 index 00000000000..040a3155f1f --- /dev/null +++ b/support/hololens/ServoApp/Bookmarks.h @@ -0,0 +1,38 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#pragma once + +#include "pch.h" +#include "Bookmark.g.h" + +namespace winrt::servo { + +using namespace winrt::Windows::Foundation; + +class Bookmarks { + +public: + Bookmarks(); + bool Contains(const hstring &url); + hstring GetName(const hstring &url); + void Set(hstring url, hstring title); + void Delete(const hstring &url); + const Collections::IObservableVector<IInspectable> &TemplateSource() { + return db; + }; + +private: + IAsyncAction WriteSettings(); + void BuildIndex(); + void InvalidateDB(); + // Array of Bookmarks as defined in the IDL + // An IObservableMap would be better, but this is not supported in XAML+winrt: + // See https://github.com/microsoft/microsoft-ui-xaml/issues/1612 + Collections::IObservableVector<IInspectable> db; + // ... so we have an additional map that link a url to the index in the array: + std::map<hstring, int> mIndex; +}; + +} // namespace winrt::servo diff --git a/support/hololens/ServoApp/BrowserPage.cpp b/support/hololens/ServoApp/BrowserPage.cpp index 42282357834..a8417d8a759 100644 --- a/support/hololens/ServoApp/BrowserPage.cpp +++ b/support/hololens/ServoApp/BrowserPage.cpp @@ -6,6 +6,7 @@ #include "strutils.h" #include "BrowserPage.h" #include "BrowserPage.g.cpp" +#include "Bookmark.g.cpp" #include "ConsoleLog.g.cpp" #include "Devtools/Client.h" @@ -43,9 +44,19 @@ BrowserPage::BrowserPage() { } void BrowserPage::BindServoEvents() { - servoView().OnURLChanged( - [=](const auto &, hstring url) { urlTextbox().Text(url); }); - servoView().OnTitleChanged([=](const auto &, hstring title) {}); + servoView().OnURLChanged([=](const auto &, hstring url) { + mCurrentUrl = url; + urlTextbox().Text(url); + UpdateBookmarkPanel(); + }); + servoView().OnTitleChanged([=](const auto &, hstring title) { + if (title.size() > 0) { + mCurrentTitle = {title}; + } else { + mCurrentTitle = {}; + } + UpdateBookmarkPanel(); + }); servoView().OnHistoryChanged([=](bool back, bool forward) { backButton().IsEnabled(back); forwardButton().IsEnabled(forward); @@ -55,6 +66,8 @@ void BrowserPage::BindServoEvents() { CheckCrashReport(); }); servoView().OnLoadStarted([=] { + mCurrentUrl = {}; + mCurrentTitle = {}; urlbarLoadingIndicator().IsActive(true); transientLoadingIndicator().IsIndeterminate(true); reloadButton().IsEnabled(false); @@ -63,6 +76,7 @@ void BrowserPage::BindServoEvents() { stopButton().Visibility(Visibility::Visible); devtoolsButton().IsEnabled(true); CheckCrashReport(); + UpdateBookmarkPanel(); }); servoView().OnLoadEnded([=] { urlbarLoadingIndicator().IsActive(false); @@ -72,6 +86,22 @@ void BrowserPage::BindServoEvents() { stopButton().IsEnabled(false); stopButton().Visibility(Visibility::Collapsed); }); + bookmarkPanel().Opening([=](const auto &, const auto &) { + if (!mCurrentUrl.has_value()) { + return; + } + hstring url = *mCurrentUrl; + auto resourceLoader = ResourceLoader::GetForCurrentView(); + if (!mBookmarks.Contains(url)) { + auto label = resourceLoader.GetString(L"bookmarkPanel/addedTitle"); + bookmarkPanelLabel().Text(label); + mBookmarks.Set(url, bookmarkPanelTitle().Text()); + } else { + auto label = resourceLoader.GetString(L"bookmarkPanel/editTitle"); + bookmarkPanelLabel().Text(label); + } + bookmarkPanelTitle().SelectAll(); + }); servoView().OnCaptureGesturesStarted([=] { servoView().Focus(FocusState::Programmatic); navigationBar().IsHitTestVisible(false); @@ -80,9 +110,9 @@ void BrowserPage::BindServoEvents() { [=] { navigationBar().IsHitTestVisible(true); }); urlTextbox().GotFocus(std::bind(&BrowserPage::OnURLFocused, this, _1)); servoView().OnMediaSessionMetadata( - [=](hstring title, hstring artist, hstring album) {}); + [=](hstring /*title*/, hstring /*artist*/, hstring /*album*/) {}); servoView().OnMediaSessionPosition( - [=](double duration, double position, double rate) {}); + [=](double /*duration*/, double /*position*/, double /*rate*/) {}); servoView().OnMediaSessionPlaybackStateChange([=](const auto &, int state) { if (state == Servo::MediaSessionPlaybackState::None) { mediaControls().Visibility(Visibility::Collapsed); @@ -106,6 +136,10 @@ void BrowserPage::BindServoEvents() { [=](const auto &, const VisibilityChangedEventArgs &args) { servoView().ChangeVisibility(args.Visible()); }); + + auto obsBM = + mBookmarks.TemplateSource().as<IObservableVector<IInspectable>>(); + obsBM.VectorChanged(std::bind(&BrowserPage::OnBookmarkDBChanged, this)); } void BrowserPage::OnURLFocused(IInspectable const &) { @@ -426,6 +460,57 @@ void BrowserPage::OnDevtoolsButtonClicked(IInspectable const &, } } +void BrowserPage::OnBookmarkDBChanged() { + Dispatcher().RunAsync(CoreDispatcherPriority::High, + [=] { UpdateBookmarkPanel(); }); +} + +void BrowserPage::UpdateBookmarkPanel() { + if (mCurrentUrl.has_value()) { + bookmarkButton().IsEnabled(true); + if (mBookmarks.Contains(*mCurrentUrl)) { + bookmarkPanelIcon().Symbol(Controls::Symbol::SolidStar); + auto name = mBookmarks.GetName(*mCurrentUrl); + bookmarkPanelTitle().Text(name); + } else { + bookmarkPanelIcon().Symbol(Controls::Symbol::OutlineStar); + auto label = mCurrentTitle.value_or(*mCurrentUrl); + bookmarkPanelTitle().Text(label); + } + } else { + bookmarkButton().IsEnabled(false); + } + if (mBookmarks.TemplateSource().Size() == 0) { + bookmarkToolbar().Visibility(Visibility::Collapsed); + } else { + bookmarkToolbar().Visibility(Visibility::Visible); + } +} + +void BrowserPage::OnBookmarkEdited(IInspectable const &, + Input::KeyRoutedEventArgs const &e) { + if (e.Key() == Windows::System::VirtualKey::Enter) { + UpdateBookmark(); + } +} + +void BrowserPage::OnBookmarkClicked(IInspectable const &sender, + RoutedEventArgs const &) { + auto button = sender.as<Controls::Button>(); + auto url = winrt::unbox_value<hstring>(button.Tag()); + servoView().LoadURIOrSearch(url); +} + +void BrowserPage::RemoveBookmark() { + mBookmarks.Delete(*mCurrentUrl); + bookmarkPanel().Hide(); +} + +void BrowserPage::UpdateBookmark() { + mBookmarks.Set(*mCurrentUrl, bookmarkPanelTitle().Text()); + bookmarkPanel().Hide(); +} + void BrowserPage::OnJSInputEdited(IInspectable const &, Input::KeyRoutedEventArgs const &e) { if (e.Key() == Windows::System::VirtualKey::Enter) { diff --git a/support/hololens/ServoApp/BrowserPage.h b/support/hololens/ServoApp/BrowserPage.h index 2a434d19354..a1e120955ac 100644 --- a/support/hololens/ServoApp/BrowserPage.h +++ b/support/hololens/ServoApp/BrowserPage.h @@ -5,12 +5,15 @@ #pragma once #include "BrowserPage.g.h" +#include "Bookmark.g.h" #include "ConsoleLog.g.h" #include "ServoControl/ServoControl.h" #include "Devtools/Client.h" +#include "Bookmarks.h" namespace winrt::ServoApp::implementation { +using namespace winrt::servo; using namespace winrt::Windows; using namespace winrt::Windows::Data::Json; using namespace winrt::Windows::Foundation; @@ -22,7 +25,7 @@ static const hstring FXR_SCHEME_SLASH_SLASH = L"fxr://"; static const hstring FXRMIN_SCHEME = L"fxrmin"; static const hstring FXRMIN_SCHEME_SLASH_SLASH = L"fxrmin://"; -struct BrowserPage : BrowserPageT<BrowserPage>, public servo::DevtoolsDelegate { +struct BrowserPage : BrowserPageT<BrowserPage>, public DevtoolsDelegate { public: BrowserPage(); @@ -32,6 +35,17 @@ public: void OnStopButtonClicked(IInspectable const &, RoutedEventArgs const &); void OnHomeButtonClicked(IInspectable const &, RoutedEventArgs const &); void OnDevtoolsButtonClicked(IInspectable const &, RoutedEventArgs const &); + void OnBookmarkClicked(IInspectable const &, RoutedEventArgs const &); + void OnUpdateBookmarkButtonClicked(IInspectable const &, + RoutedEventArgs const &) { + UpdateBookmark(); + }; + void OnRemoveBookmarkButtonClicked(IInspectable const &, + RoutedEventArgs const &) { + RemoveBookmark(); + }; + void OnBookmarkEdited(IInspectable const &, + Input::KeyRoutedEventArgs const &); void OnJSInputEdited(IInspectable const &, Input::KeyRoutedEventArgs const &); void OnURLEdited(IInspectable const &, Input::KeyRoutedEventArgs const &); void OnSeeAllPrefClicked(IInspectable const &, RoutedEventArgs const &); @@ -50,11 +64,15 @@ public: RoutedEventArgs const &); void OnPrefererenceSearchboxEdited(IInspectable const &, Input::KeyRoutedEventArgs const &); - void OnDevtoolsMessage(servo::DevtoolsMessageLevel, hstring, hstring); + void OnDevtoolsMessage(DevtoolsMessageLevel, hstring, hstring); void ClearConsole(); void OnDevtoolsDetached(); Collections::IObservableVector<IInspectable> ConsoleLogs() { return mLogs; }; - void BuildPrefList(); + Collections::IObservableVector<IInspectable> Bookmarks() { + return mBookmarks.TemplateSource(); + }; + void RemoveBookmark(); + void UpdateBookmark(); private: void SetTransientMode(bool); @@ -63,13 +81,19 @@ private: void BindServoEvents(); void ShowToolbox(); void HideToolbox(); + void BuildPrefList(); + void UpdateBookmarkPanel(); + void OnBookmarkDBChanged(); DevtoolsStatus mDevtoolsStatus = DevtoolsStatus::Stopped; unsigned int mDevtoolsPort = 0; hstring mDevtoolsToken; bool mPanicking = false; - std::unique_ptr<servo::DevtoolsClient> mDevtoolsClient; + std::unique_ptr<DevtoolsClient> mDevtoolsClient; Collections::IObservableVector<IInspectable> mLogs; std::map<hstring, hstring> mPromotedPrefs; + std::optional<hstring> mCurrentUrl; + std::optional<hstring> mCurrentTitle; + servo::Bookmarks mBookmarks; }; struct ConsoleLog : ConsoleLogT<ConsoleLog> { @@ -90,9 +114,21 @@ private: hstring mBody; }; +struct Bookmark : BookmarkT<Bookmark> { +public: + Bookmark(hstring url, hstring name) : mName(name), mUrl(url){}; + hstring Name() { return mName; }; + hstring Url() { return mUrl; }; + +private: + hstring mName; + hstring mUrl; +}; + } // namespace winrt::ServoApp::implementation namespace winrt::ServoApp::factory_implementation { struct BrowserPage : BrowserPageT<BrowserPage, implementation::BrowserPage> {}; struct ConsoleLog : ConsoleLogT<ConsoleLog, implementation::ConsoleLog> {}; +struct Bookmark : BookmarkT<Bookmark, implementation::Bookmark> {}; } // namespace winrt::ServoApp::factory_implementation diff --git a/support/hololens/ServoApp/BrowserPage.idl b/support/hololens/ServoApp/BrowserPage.idl index 107724b1616..4579d937a70 100644 --- a/support/hololens/ServoApp/BrowserPage.idl +++ b/support/hololens/ServoApp/BrowserPage.idl @@ -5,6 +5,7 @@ namespace ServoApp { BrowserPage(); Windows.Foundation.Collections.IObservableVector<IInspectable> ConsoleLogs{ get; }; + Windows.Foundation.Collections.IObservableVector<IInspectable> Bookmarks{ get; }; } runtimeclass ConsoleLog @@ -15,4 +16,11 @@ namespace ServoApp String Body{ get; }; String Source{ get; }; } + + runtimeclass Bookmark + { + Bookmark(String name, String url); + String Name{ get; }; + String Url{ get; }; + } } diff --git a/support/hololens/ServoApp/BrowserPage.xaml b/support/hololens/ServoApp/BrowserPage.xaml index 28d6871a3c9..2b1c6b0e121 100644 --- a/support/hololens/ServoApp/BrowserPage.xaml +++ b/support/hololens/ServoApp/BrowserPage.xaml @@ -83,11 +83,12 @@ <Grid VerticalAlignment="Stretch"> <Grid.RowDefinitions> - <RowDefinition Height="auto"/> - <RowDefinition Height="*" MinHeight="200"/> - <RowDefinition Height="auto"/> - <RowDefinition Height="auto"/> - <RowDefinition Height="auto"/> + <RowDefinition Height="auto"/> <!-- navigation bar --> + <RowDefinition Height="auto"/> <!-- bookmarks bar --> + <RowDefinition Height="*" MinHeight="200"/> <!-- Servo --> + <RowDefinition Height="auto"/> <!-- devtools tabs --> + <RowDefinition Height="auto"/> <!-- loading indicator for transient mode --> + <RowDefinition Height="auto"/> <!-- media controls --> </Grid.RowDefinitions> <Grid Grid.Row="0" x:Name="navigationBar" Background="{ThemeResource InkToolbarButtonBackgroundThemeBrush}"> <Grid.ColumnDefinitions> @@ -130,6 +131,24 @@ </TextBox.KeyboardAccelerators> </TextBox> <StackPanel Orientation="Horizontal" Grid.Column="2"> + <Button Style="{StaticResource NavigationBarButton}" x:Uid="bookmarkButton" x:Name="bookmarkButton" IsTabStop="true" IsEnabled="false"> + <SymbolIcon x:Name="bookmarkPanelIcon" Symbol="OutlineStar"/> + <Button.KeyboardAccelerators> + <KeyboardAccelerator Key="B" Modifiers="Control" /> + </Button.KeyboardAccelerators> + <Button.Flyout> + <Flyout x:Name="bookmarkPanel"> + <StackPanel Orientation="Vertical" MinWidth="200"> + <TextBlock x:Name="bookmarkPanelLabel"/> + <TextBox x:Name="bookmarkPanelTitle" VerticalAlignment="Center" IsSpellCheckEnabled="False" KeyUp="OnBookmarkEdited" /> + <StackPanel Orientation="Horizontal"> + <Button Margin="4" x:Uid="rmBookmarkButton" Click="OnRemoveBookmarkButtonClicked"/> + <Button Margin="4" x:Uid="upBookmarkButton" Click="OnUpdateBookmarkButtonClicked"/> + </StackPanel> + </StackPanel> + </Flyout> + </Button.Flyout> + </Button> <Button Style="{StaticResource NavigationBarButton}" x:Name="devtoolsButton" IsEnabled="false" x:Uid="devtoolsButton" IsTabStop="true" Click="OnDevtoolsButtonClicked"> <!-- EC7A is the "DeveloperTools" symbol, not exported in the symbol list for some reason --> <FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/> @@ -137,8 +156,24 @@ <ProgressRing x:Name="urlbarLoadingIndicator" Margin="10,0"/> </StackPanel> </Grid> - <local:ServoControl Grid.Row="1" TabIndex="0" x:Name="servoView"/> - <muxc:TabView x:Name="toolbox" IsAddTabButtonVisible="False" Grid.Row="2" Visibility="Collapsed" Height="300"> + + <ItemsControl ItemsSource="{x:Bind Bookmarks}" Grid.Row="1" x:Name="bookmarkToolbar"> + <ItemsControl.ItemTemplate> + <DataTemplate x:DataType="local:Bookmark"> + <StackPanel Orientation="Horizontal"> + <Button Tag="{x:Bind Url}" ToolTipService.ToolTip="{x:Bind Url}" Background="Transparent" Content="{x:Bind Name}" Click="OnBookmarkClicked"/> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" Padding="4" Background="{ThemeResource InkToolbarButtonBackgroundThemeBrush}"/> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> + + <local:ServoControl Grid.Row="2" TabIndex="0" x:Name="servoView"/> + <muxc:TabView x:Name="toolbox" IsAddTabButtonVisible="False" Grid.Row="3" Visibility="Collapsed" Height="300"> <muxc:TabView.TabStripFooter> <Grid> <Grid.ColumnDefinitions> @@ -216,8 +251,8 @@ </Grid> </muxc:TabViewItem> </muxc:TabView> - <ProgressBar x:Name="transientLoadingIndicator" Visibility="Collapsed" Grid.Row="3"/> - <CommandBar Grid.Row="4" x:Name="mediaControls" Visibility="Collapsed"> + <ProgressBar x:Name="transientLoadingIndicator" Visibility="Collapsed" Grid.Row="4"/> + <CommandBar Grid.Row="5" x:Name="mediaControls" Visibility="Collapsed"> <AppBarButton Icon="Play" x:Uid="playButton" x:Name="playButton" Visibility="Collapsed" Click="OnMediaControlsPlayClicked"/> <AppBarButton Icon="Pause" x:Uid="pauseButton" x:Name="pauseButton" Click="OnMediaControlsPauseClicked"/> </CommandBar> diff --git a/support/hololens/ServoApp/Resources/Strings/en-US/Resources.resw b/support/hololens/ServoApp/Resources/Strings/en-US/Resources.resw index 2a271eed980..0afdf9869a3 100644 --- a/support/hololens/ServoApp/Resources/Strings/en-US/Resources.resw +++ b/support/hololens/ServoApp/Resources/Strings/en-US/Resources.resw @@ -60,118 +60,130 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="appDescription" xml:space="preserve"> + <data name="appDescription"> <value>Firefox Reality brings the best and freshest content from the web that you know and love to Virtual Reality headsets. Our browser provides an open, accessible and secure way for everyone to explore the web. Experience sharp text, high quality videos, and a seamless transition from 2D to 3D immersive modes. Enjoy the best possible web browsing experience with Firefox Reality.</value> </data> - <data name="backButton.AutomationProperties.Name" xml:space="preserve"> + <data name="backButton.AutomationProperties.Name"> <value>Back</value> <comment>Will be recognized by the speech recognition system</comment> </data> - <data name="backButton.ToolTipService.ToolTip" xml:space="preserve"> + <data name="backButton.ToolTipService.ToolTip"> <value>Back</value> </data> - <data name="devtoolsButton.AutomationProperties.Name" xml:space="preserve"> + <data name="devtoolsButton.AutomationProperties.Name"> <value>Developer Tools</value> <comment>Will be recognized by the speech recognition system</comment> </data> - <data name="devtoolsButton.ToolTipService.ToolTip" xml:space="preserve"> + <data name="devtoolsButton.ToolTipService.ToolTip"> <value>Developer Tools</value> </data> - <data name="forwardButton.AutomationProperties.Name" xml:space="preserve"> + <data name="forwardButton.AutomationProperties.Name"> <value>Forward</value> <comment>Will be recognized by the speech recognition system</comment> </data> - <data name="forwardButton.ToolTipService.ToolTip" xml:space="preserve"> + <data name="forwardButton.ToolTipService.ToolTip"> <value>Forward</value> </data> - <data name="homeButton.AutomationProperties.Name" xml:space="preserve"> + <data name="homeButton.AutomationProperties.Name"> <value>Home</value> <comment>Will be recognized by the speech recognition system</comment> </data> - <data name="homeButton.ToolTipService.ToolTip" xml:space="preserve"> + <data name="homeButton.ToolTipService.ToolTip"> <value>Home</value> </data> - <data name="reloadButton.AutomationProperties.Name" xml:space="preserve"> + <data name="reloadButton.AutomationProperties.Name"> <value>Reload</value> <comment>Will be recognized by the speech recognition system</comment> </data> - <data name="reloadButton.ToolTipService.ToolTip" xml:space="preserve"> + <data name="reloadButton.ToolTipService.ToolTip"> <value>Reload</value> </data> - <data name="stopButton.AutomationProperties.Name" xml:space="preserve"> + <data name="stopButton.AutomationProperties.Name"> <value>Stop</value> <comment>Will be recognized by the speech recognition system</comment> </data> - <data name="stopButton.ToolTipService.ToolTip" xml:space="preserve"> + <data name="stopButton.ToolTipService.ToolTip"> <value>Stop</value> </data> - <data name="urlTextbox.PlaceholderText" xml:space="preserve"> + <data name="urlTextbox.PlaceholderText"> <value>Type a URL</value> </data> - <data name="devtoolsTabConsole.[using:Microsoft.UI.Xaml.Controls]TabViewItem.Header" xml:space="preserve"> + <data name="devtoolsTabConsole.[using:Microsoft.UI.Xaml.Controls]TabViewItem.Header"> <value>Console</value> </data> - <data name="devtoolsTabPrefs.[using:Microsoft.UI.Xaml.Controls]TabViewItem.Header" xml:space="preserve"> + <data name="devtoolsTabPrefs.[using:Microsoft.UI.Xaml.Controls]TabViewItem.Header"> <value>Preferences</value> </data> - <data name="crashTab.[using:Microsoft.UI.Xaml.Controls]TabViewItem.Header" xml:space="preserve"> + <data name="crashTab.[using:Microsoft.UI.Xaml.Controls]TabViewItem.Header"> <value>Crash Report</value> </data> - <data name="crash.Happening" xml:space="preserve"> + <data name="crash.Happening"> <value>Internal crash detected. Application might be unstable:</value> </data> - <data name="crash.Happened" xml:space="preserve"> + <data name="crash.Happened"> <value>Internal crash was detected during last run:</value> </data> - <data name="SubmitCrashReportButton.Content" xml:space="preserve"> + <data name="SubmitCrashReportButton.Content"> <value>Send crash report</value> </data> - <data name="DismissCrashReportButton.Content" xml:space="preserve"> + <data name="DismissCrashReportButton.Content"> <value>Dismiss</value> </data> - <data name="preferenceSearchbox.PlaceholderText" xml:space="preserve"> + <data name="preferenceSearchbox.PlaceholderText"> <value>Search Preferences</value> </data> - <data name="playButton.Label" xml:space="preserve"> + <data name="playButton.Label"> <value>Play</value> </data> - <data name="pauseButton.Label" xml:space="preserve"> + <data name="pauseButton.Label"> <value>Pause</value> </data> - <data name="devtoolsStatus.Running" xml:space="preserve"> + <data name="devtoolsStatus.Running"> <value>Devtools server is listening on port %s.</value> </data> - <data name="devtoolsStatus.Failed" xml:space="preserve"> + <data name="devtoolsStatus.Failed"> <value>Devtools server failed to start.</value> </data> - <data name="devtoolsStatus.Stopped" xml:space="preserve"> + <data name="devtoolsStatus.Stopped"> <value>Devtools server is starting.</value> </data> - <data name="devtoolsPreferenceResetButton.Content" xml:space="preserve"> + <data name="devtoolsPreferenceResetButton.Content"> <value>reset</value> </data> - <data name="URINotValid.Alert" xml:space="preserve"> + <data name="URINotValid.Alert"> <value>URI not valid</value> </data> - <data name="JavascriptPrompt.ok" xml:space="preserve"> + <data name="JavascriptPrompt.ok"> <value>ok</value> </data> - <data name="JavascriptPrompt.cancel" xml:space="preserve"> + <data name="JavascriptPrompt.cancel"> <value>cancel</value> </data> - <data name="JavascriptPrompt.yes" xml:space="preserve"> + <data name="JavascriptPrompt.yes"> <value>yes</value> </data> - <data name="JavascriptPrompt.no" xml:space="preserve"> + <data name="JavascriptPrompt.no"> <value>no</value> </data> - <data name="JavascriptPrompt.title" xml:space="preserve"> + <data name="JavascriptPrompt.title"> <value>"%s" says:</value> </data> - <data name="ContextMenu.title" xml:space="preserve"> + <data name="ContextMenu.title"> <value>Menu</value> </data> - <data name="seeAllPrefCheckBox.Content" xml:space="preserve"> + <data name="seeAllPrefCheckBox.Content"> <value>See all preferences</value> </data> + <data name="upBookmarkButton.Content"> + <value>Done</value> + </data> + <data name="rmBookmarkButton.Content"> + <value>Remove</value> + </data> + <data name="bookmarkPanel.addedTitle"> + <value>Bookmark added</value> + </data> + <data name="bookmarkPanel.editTitle"> + <value>Edit bookmark:</value> + </data> </root> diff --git a/support/hololens/ServoApp/ServoApp.vcxproj b/support/hololens/ServoApp/ServoApp.vcxproj index ec28c1d9a27..90af50ac707 100644 --- a/support/hololens/ServoApp/ServoApp.vcxproj +++ b/support/hololens/ServoApp/ServoApp.vcxproj @@ -123,6 +123,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> + <ClInclude Include="Bookmarks.h" /> <ClInclude Include="Devtools\Client.h" /> <ClInclude Include="ServoControl\Keys.h" /> <ClInclude Include="strutils.h" /> @@ -961,6 +962,7 @@ <Image Include="Assets\Wide310x150Logo.scale-400.png" /> </ItemGroup> <ItemGroup> + <ClCompile Include="Bookmarks.cpp" /> <ClCompile Include="Devtools\Client.cpp" /> <ClCompile Include="pch.cpp"> <PrecompiledHeader>Create</PrecompiledHeader> diff --git a/support/hololens/ServoApp/ServoApp.vcxproj.filters b/support/hololens/ServoApp/ServoApp.vcxproj.filters index a017554e1ba..aca41c20608 100644 --- a/support/hololens/ServoApp/ServoApp.vcxproj.filters +++ b/support/hololens/ServoApp/ServoApp.vcxproj.filters @@ -24,6 +24,7 @@ <ClCompile Include="Devtools\Client.cpp"> <Filter>Devtools</Filter> </ClCompile> + <ClCompile Include="Bookmarks.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="pch.h" /> @@ -46,6 +47,7 @@ <ClInclude Include="ServoControl\Keys.h"> <Filter>ServoControl</Filter> </ClInclude> + <ClInclude Include="Bookmarks.h" /> </ItemGroup> <ItemGroup> <Image Include="Assets\Wide310x150Logo.scale-200.png"> @@ -963,4 +965,4 @@ <Filter>Resources\Strings\fr-FR</Filter> </PRIResource> </ItemGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/support/hololens/ServoApp/ServoControl/ServoControl.h b/support/hololens/ServoApp/ServoControl/ServoControl.h index 8775127e206..dda8a1ad91f 100644 --- a/support/hololens/ServoApp/ServoControl/ServoControl.h +++ b/support/hololens/ServoApp/ServoControl/ServoControl.h @@ -39,7 +39,7 @@ struct ServoControl : ServoControlT<ServoControl>, public servo::ServoDelegate { ServoControl(); - Windows::Foundation::Collections::IVector<ServoApp::Pref> Preferences(); + IVector<ServoApp::Pref> Preferences(); void GoBack(); void GoForward(); |