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

Unified Diff: ui/views/mus/native_widget_mus.cc

Issue 1416373010: Implement a MusBrowserFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome
Patch Set: . Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/native_widget_mus.h ('k') | ui/views/mus/window_manager_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/native_widget_mus.cc
diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc
index ccc90d211c735542c279700025406a3012930d1d..efed7c25ab7f428983783fe12c65db829c9bbea8 100644
--- a/ui/views/mus/native_widget_mus.cc
+++ b/ui/views/mus/native_widget_mus.cc
@@ -8,6 +8,7 @@
#include "components/mus/public/cpp/window.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "ui/aura/client/default_capture_client.h"
+#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
@@ -69,6 +70,29 @@ class ContentWindowLayoutManager : public aura::LayoutManager {
DISALLOW_COPY_AND_ASSIGN(ContentWindowLayoutManager);
};
+class NativeWidgetMusWindowTreeClient : public aura::client::WindowTreeClient {
+ public:
+ explicit NativeWidgetMusWindowTreeClient(aura::Window* root_window)
+ : root_window_(root_window) {
+ aura::client::SetWindowTreeClient(root_window_, this);
+ }
+ ~NativeWidgetMusWindowTreeClient() override {
+ aura::client::SetWindowTreeClient(root_window_, nullptr);
+ }
+
+ // Overridden from client::WindowTreeClient:
+ aura::Window* GetDefaultParent(aura::Window* context,
+ aura::Window* window,
+ const gfx::Rect& bounds) override {
+ return root_window_;
+ }
+
+ private:
+ aura::Window* root_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(NativeWidgetMusWindowTreeClient);
+};
+
// As the window manager renderers the non-client decorations this class does
// very little but honor the client area insets from the window manager.
class ClientSideNonClientFrameView : public NonClientFrameView {
@@ -191,6 +215,8 @@ void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) {
focus_client_.get());
aura::client::SetActivationClient(window_tree_host_->window(),
focus_client_.get());
+ window_tree_client_.reset(
+ new NativeWidgetMusWindowTreeClient(window_tree_host_->window()));
window_tree_host_->window()->AddPreTargetHandler(focus_client_.get());
window_tree_host_->window()->SetLayoutManager(
new ContentWindowLayoutManager(window_tree_host_->window(), content_));
@@ -199,6 +225,7 @@ void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) {
content_->SetType(ui::wm::WINDOW_TYPE_NORMAL);
content_->Init(ui::LAYER_TEXTURED);
+ content_->Show();
content_->SetTransparent(true);
content_->SetFillsBoundsCompletely(false);
@@ -383,8 +410,8 @@ void NativeWidgetMus::ShowWithWindowState(ui::WindowShowState state) {
}
bool NativeWidgetMus::IsVisible() const {
- // NOTIMPLEMENTED();
- return true;
+ // TODO(beng): this should probably be wired thru PlatformWindow.
+ return window_tree_host_->mus_window()->visible();
}
void NativeWidgetMus::Activate() {
« no previous file with comments | « ui/views/mus/native_widget_mus.h ('k') | ui/views/mus/window_manager_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698