Skip to content

Commit

Permalink
[Fuchsia] Migrate from Present2() to PresentView() API.
Browse files Browse the repository at this point in the history
Bug: 943604
Change-Id: I890ef1c1ae0683fc0fd64567001498574c84e5d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531005
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642166}
  • Loading branch information
Wez authored and Commit Bot committed Mar 19, 2019
1 parent 048202e commit fce5a4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ui/platform_window/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ source_set("platform_window") {
public_deps = [
"//third_party/fuchsia-sdk/sdk:ui_gfx",
"//third_party/fuchsia-sdk/sdk:ui_policy",
"//third_party/fuchsia-sdk/sdk:ui_views",
]
}
}
Expand Down
7 changes: 4 additions & 3 deletions ui/platform_window/fuchsia/initialize_presenter_api_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ui/platform_window/fuchsia/initialize_presenter_api_view.h"

#include <fuchsia/ui/policy/cpp/fidl.h>
#include <fuchsia/ui/views/cpp/fidl.h>
#include <lib/zx/eventpair.h>

#include "base/fuchsia/fuchsia_logging.h"
Expand All @@ -19,17 +20,17 @@ void InitializeViewTokenAndPresentView(

// Generate and set the view tokens for the |window_properties_out| and the
// Presenter API.
zx::eventpair view_holder_token;
::fuchsia::ui::views::ViewHolderToken view_holder_token;
zx_status_t status = zx::eventpair::create(
/* options = */ 0, &window_properties_out->view_token.value,
&view_holder_token);
&view_holder_token.value);
ZX_CHECK(status == ZX_OK, status) << "zx_eventpair_create";

// Request Presenter to show the view full-screen.
auto presenter = base::fuchsia::ServiceDirectoryClient::ForCurrentProcess()
->ConnectToService<::fuchsia::ui::policy::Presenter>();

presenter->Present2(std::move(view_holder_token), nullptr);
presenter->PresentView(std::move(view_holder_token), nullptr);
}

} // namespace fuchsia
Expand Down

0 comments on commit fce5a4a

Please sign in to comment.