Commit 36290334 authored by Wez's avatar Wez Committed by Commit Bot

[fuchsia] Rename the WebEngine's LayoutManager.

Rather than prefixing the name with Fuchsia, prefix with Frame, to
reflect the scope to which it applies.

Change-Id: I8d946ea9076f3fc04193cfc3ea8a44d830109ac0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2038775
Auto-Submit: Wez <wez@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738609}
parent 609eaba7
...@@ -132,8 +132,8 @@ component("web_engine_core") { ...@@ -132,8 +132,8 @@ component("web_engine_core") {
"browser/discarding_event_filter.h", "browser/discarding_event_filter.h",
"browser/frame_impl.cc", "browser/frame_impl.cc",
"browser/frame_impl.h", "browser/frame_impl.h",
"browser/fuchsia_layout_manager.cc", "browser/frame_layout_manager.cc",
"browser/fuchsia_layout_manager.h", "browser/frame_layout_manager.h",
"browser/navigation_controller_impl.cc", "browser/navigation_controller_impl.cc",
"browser/navigation_controller_impl.h", "browser/navigation_controller_impl.h",
"browser/url_request_rewrite_rules_manager.cc", "browser/url_request_rewrite_rules_manager.cc",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "fuchsia/base/message_port.h" #include "fuchsia/base/message_port.h"
#include "fuchsia/engine/browser/accessibility_bridge.h" #include "fuchsia/engine/browser/accessibility_bridge.h"
#include "fuchsia/engine/browser/context_impl.h" #include "fuchsia/engine/browser/context_impl.h"
#include "fuchsia/engine/browser/fuchsia_layout_manager.h" #include "fuchsia/engine/browser/frame_layout_manager.h"
#include "fuchsia/engine/browser/web_engine_devtools_controller.h" #include "fuchsia/engine/browser/web_engine_devtools_controller.h"
#include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/system/platform_handle.h" #include "mojo/public/cpp/system/platform_handle.h"
...@@ -739,7 +739,7 @@ void FrameImpl::SetWindowTreeHost( ...@@ -739,7 +739,7 @@ void FrameImpl::SetWindowTreeHost(
wm::SetActivationClient(root_window(), focus_controller_.get()); wm::SetActivationClient(root_window(), focus_controller_.get());
layout_manager_ = new FuchsiaLayoutManager; layout_manager_ = new FrameLayoutManager;
root_window()->SetLayoutManager(layout_manager_); // Transfers ownership. root_window()->SetLayoutManager(layout_manager_); // Transfers ownership.
if (!render_size_override_.IsEmpty()) if (!render_size_override_.IsEmpty())
layout_manager_->ForceContentDimensions(render_size_override_); layout_manager_->ForceContentDimensions(render_size_override_);
......
...@@ -39,7 +39,7 @@ class FromRenderFrameHost; ...@@ -39,7 +39,7 @@ class FromRenderFrameHost;
} // namespace content } // namespace content
class ContextImpl; class ContextImpl;
class FuchsiaLayoutManager; class FrameLayoutManager;
// Implementation of fuchsia.web.Frame based on content::WebContents. // Implementation of fuchsia.web.Frame based on content::WebContents.
class FrameImpl : public fuchsia::web::Frame, class FrameImpl : public fuchsia::web::Frame,
...@@ -200,15 +200,17 @@ class FrameImpl : public fuchsia::web::Frame, ...@@ -200,15 +200,17 @@ class FrameImpl : public fuchsia::web::Frame,
void DidFinishLoad(content::RenderFrameHost* render_frame_host, void DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) override; const GURL& validated_url) override;
const std::unique_ptr<content::WebContents> web_contents_;
ContextImpl* const context_;
std::unique_ptr<aura::WindowTreeHost> window_tree_host_; std::unique_ptr<aura::WindowTreeHost> window_tree_host_;
// Dependents of |window_tree_host_|.
std::unique_ptr<wm::FocusController> focus_controller_; std::unique_ptr<wm::FocusController> focus_controller_;
DiscardingEventFilter discarding_event_filter_; DiscardingEventFilter discarding_event_filter_;
FuchsiaLayoutManager* layout_manager_ = nullptr;
const std::unique_ptr<content::WebContents> web_contents_; // Owned via |window_tree_host_|.
ContextImpl* const context_; FrameLayoutManager* layout_manager_ = nullptr;
std::unique_ptr<AccessibilityBridge> accessibility_bridge_; std::unique_ptr<AccessibilityBridge> accessibility_bridge_;
fuchsia::accessibility::semantics::SemanticsManagerPtr fuchsia::accessibility::semantics::SemanticsManagerPtr
semantics_manager_for_test_; semantics_manager_for_test_;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "fuchsia/engine/browser/fuchsia_layout_manager.h" #include "fuchsia/engine/browser/frame_layout_manager.h"
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
...@@ -34,21 +34,21 @@ float ProportionalScale(gfx::Size inset, gfx::Size container) { ...@@ -34,21 +34,21 @@ float ProportionalScale(gfx::Size inset, gfx::Size container) {
} // namespace } // namespace
FuchsiaLayoutManager::FuchsiaLayoutManager() {} FrameLayoutManager::FrameLayoutManager() {}
FuchsiaLayoutManager::~FuchsiaLayoutManager() {} FrameLayoutManager::~FrameLayoutManager() {}
void FuchsiaLayoutManager::ForceContentDimensions(gfx::Size size) { void FrameLayoutManager::ForceContentDimensions(gfx::Size size) {
render_size_override_ = size; render_size_override_ = size;
UpdateContentBounds(); UpdateContentBounds();
} }
void FuchsiaLayoutManager::OnWindowResized() { void FrameLayoutManager::OnWindowResized() {
// Resize the child to match the size of the parent. // Resize the child to match the size of the parent.
UpdateContentBounds(); UpdateContentBounds();
} }
void FuchsiaLayoutManager::OnWindowAddedToLayout(aura::Window* child) { void FrameLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
if (child->type() == aura::client::WINDOW_TYPE_CONTROL) { if (child->type() == aura::client::WINDOW_TYPE_CONTROL) {
DCHECK(!main_child_); DCHECK(!main_child_);
main_child_ = child; main_child_ = child;
...@@ -59,25 +59,25 @@ void FuchsiaLayoutManager::OnWindowAddedToLayout(aura::Window* child) { ...@@ -59,25 +59,25 @@ void FuchsiaLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
} }
} }
void FuchsiaLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { void FrameLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {
if (child->type() == aura::client::WINDOW_TYPE_CONTROL) { if (child->type() == aura::client::WINDOW_TYPE_CONTROL) {
DCHECK_EQ(child, main_child_); DCHECK_EQ(child, main_child_);
main_child_ = nullptr; main_child_ = nullptr;
} }
} }
void FuchsiaLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {} void FrameLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {}
void FuchsiaLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, void FrameLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
bool visible) {} bool visible) {}
void FuchsiaLayoutManager::SetChildBounds(aura::Window* child, void FrameLayoutManager::SetChildBounds(aura::Window* child,
const gfx::Rect& requested_bounds) { const gfx::Rect& requested_bounds) {
if (child != main_child_) if (child != main_child_)
SetChildBoundsDirect(child, requested_bounds); SetChildBoundsDirect(child, requested_bounds);
} }
void FuchsiaLayoutManager::UpdateContentBounds() { void FrameLayoutManager::UpdateContentBounds() {
if (!main_child_) if (!main_child_)
return; return;
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef FUCHSIA_ENGINE_BROWSER_FUCHSIA_LAYOUT_MANAGER_H_ #ifndef FUCHSIA_ENGINE_BROWSER_FRAME_LAYOUT_MANAGER_H_
#define FUCHSIA_ENGINE_BROWSER_FUCHSIA_LAYOUT_MANAGER_H_ #define FUCHSIA_ENGINE_BROWSER_FRAME_LAYOUT_MANAGER_H_
#include "base/macros.h"
#include "ui/aura/layout_manager.h" #include "ui/aura/layout_manager.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
...@@ -15,10 +14,13 @@ ...@@ -15,10 +14,13 @@
// boxes). These windows get the location and size they request. The main // boxes). These windows get the location and size they request. The main
// window for the web content is identified by window.type() == // window for the web content is identified by window.type() ==
// WINDOW_TYPE_CONTROL (set in WebContentsViewAura). // WINDOW_TYPE_CONTROL (set in WebContentsViewAura).
class FuchsiaLayoutManager : public aura::LayoutManager { class FrameLayoutManager : public aura::LayoutManager {
public: public:
FuchsiaLayoutManager(); FrameLayoutManager();
~FuchsiaLayoutManager() override; ~FrameLayoutManager() override;
FrameLayoutManager(const FrameLayoutManager&) = delete;
FrameLayoutManager& operator=(const FrameLayoutManager&) = delete;
// Renders web content within a virtual window of a given |size|, which is // Renders web content within a virtual window of a given |size|, which is
// proportionately scaled to fit within the View. // proportionately scaled to fit within the View.
...@@ -45,8 +47,6 @@ class FuchsiaLayoutManager : public aura::LayoutManager { ...@@ -45,8 +47,6 @@ class FuchsiaLayoutManager : public aura::LayoutManager {
aura::Window* main_child_ = nullptr; aura::Window* main_child_ = nullptr;
gfx::Size render_size_override_; gfx::Size render_size_override_;
DISALLOW_COPY_AND_ASSIGN(FuchsiaLayoutManager);
}; };
#endif // FUCHSIA_ENGINE_BROWSER_FUCHSIA_LAYOUT_MANAGER_H_ #endif // FUCHSIA_ENGINE_BROWSER_FRAME_LAYOUT_MANAGER_H_
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