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

Unified Diff: mash/wm/non_client_frame_controller.cc

Issue 1848653006: Random wm frame painting fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override Created 4 years, 9 months 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 | « mash/wm/non_client_frame_controller.h ('k') | mash/wm/property_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/non_client_frame_controller.cc
diff --git a/mash/wm/non_client_frame_controller.cc b/mash/wm/non_client_frame_controller.cc
index 774329a3b917c96cd4d64947a681413e343e9db5..157eaf0f5fd4b8940cd0c66eb64b2726cf814027 100644
--- a/mash/wm/non_client_frame_controller.cc
+++ b/mash/wm/non_client_frame_controller.cc
@@ -173,6 +173,24 @@ class ClientViewMus : public views::ClientView {
} // namespace
+// static
+void NonClientFrameController::Create(
+ mojo::Connector* connector,
+ mus::Window* window,
+ mus::WindowManagerClient* window_manager_client) {
+ new NonClientFrameController(connector, window, window_manager_client);
+}
+
+// static
+gfx::Insets NonClientFrameController::GetPreferredClientAreaInsets() {
+ return NonClientFrameViewMash::GetPreferredClientAreaInsets();
+}
+
+// static
+int NonClientFrameController::GetMaxTitleBarButtonWidth() {
+ return NonClientFrameViewMash::GetMaxTitleBarButtonWidth();
+}
+
NonClientFrameController::NonClientFrameController(
mojo::Connector* connector,
mus::Window* window,
@@ -180,6 +198,10 @@ NonClientFrameController::NonClientFrameController(
: widget_(new views::Widget), window_(window) {
window_->AddObserver(this);
+ // To simplify things this code creates a Widget. While a Widget is created
+ // we need to ensure we don't inadvertently change random properties of the
+ // underlying mus::Window. For example, showing the Widget shouldn't change
+ // the bounds of the mus::Window in anyway.
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
// We initiate focus at the mus level, not at the views level.
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
@@ -195,16 +217,6 @@ NonClientFrameController::NonClientFrameController(
FrameBorderHitTestController::GetResizeOutsideBoundsSize());
}
-// static
-gfx::Insets NonClientFrameController::GetPreferredClientAreaInsets() {
- return NonClientFrameViewMash::GetPreferredClientAreaInsets();
-}
-
-// static
-int NonClientFrameController::GetMaxTitleBarButtonWidth() {
- return NonClientFrameViewMash::GetMaxTitleBarButtonWidth();
-}
-
NonClientFrameController::~NonClientFrameController() {
if (window_)
window_->RemoveObserver(this);
« no previous file with comments | « mash/wm/non_client_frame_controller.h ('k') | mash/wm/property_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698