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

Side by Side Diff: components/mus/example/wm/non_client_frame_controller.cc

Issue 1419793006: Makes windowmanager draw non-client area (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move wm nonclientframeview to wm 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/mus/example/wm/non_client_frame_controller.h"
6
7 #include "components/mus/example/wm/non_client_frame_view_impl.h"
8 #include "components/mus/public/cpp/window.h"
9 #include "ui/views/mus/native_widget_mus.h"
10 #include "ui/views/widget/widget.h"
11
12 namespace {
13
14 class WmNativeWidgetMus : public views::NativeWidgetMus {
Ben Goodger (Google) 2015/11/04 23:03:21 I don't think you need to subclass here. Instead t
sky 2015/11/05 00:18:01 CustomFrameView and related classes assume they ar
15 public:
16 WmNativeWidgetMus(views::internal::NativeWidgetDelegate* delegate,
17 mojo::Shell* shell,
18 mus::Window* window)
19 : NativeWidgetMus(delegate,
20 shell,
21 window,
22 mus::mojom::SURFACE_TYPE_UNDERLAY) {}
23 ~WmNativeWidgetMus() override {}
24
25 // NativeWidgetMus:
26 views::NonClientFrameView* CreateNonClientFrameView() override {
27 NonClientFrameViewImpl* frame_view = new NonClientFrameViewImpl(window());
28 frame_view->Init(
29 static_cast<views::internal::NativeWidgetPrivate*>(this)->GetWidget());
30 return frame_view;
31 }
32
33 private:
34 DISALLOW_COPY_AND_ASSIGN(WmNativeWidgetMus);
35 };
36
37 } // namespace
38
39 NonClientFrameController::NonClientFrameController(mojo::Shell* shell,
40 mus::Window* window) {
41 views::Widget* widget = new views::Widget;
42 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
43 params.delegate = this;
44 params.native_widget = new WmNativeWidgetMus(widget, shell, window);
45 widget->Init(params);
46 widget->Show();
47 }
48
49 NonClientFrameController::~NonClientFrameController() {}
50
51 views::View* NonClientFrameController::GetContentsView() {
52 return this;
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698