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

Side by Side Diff: mash/wm/non_client_frame_controller.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « mash/wm/non_client_frame_controller.h ('k') | mash/wm/root_window_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mash/wm/non_client_frame_controller.h" 5 #include "mash/wm/non_client_frame_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/mus/public/cpp/property_type_converters.h" 10 #include "components/mus/public/cpp/property_type_converters.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 aura::Window* window_; 83 aura::Window* window_;
84 const ShadowStyle style_; 84 const ShadowStyle style_;
85 Shadow* shadow_; 85 Shadow* shadow_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(ContentWindowLayoutManager); 87 DISALLOW_COPY_AND_ASSIGN(ContentWindowLayoutManager);
88 }; 88 };
89 89
90 class WmNativeWidgetMus : public views::NativeWidgetMus { 90 class WmNativeWidgetMus : public views::NativeWidgetMus {
91 public: 91 public:
92 WmNativeWidgetMus(views::internal::NativeWidgetDelegate* delegate, 92 WmNativeWidgetMus(views::internal::NativeWidgetDelegate* delegate,
93 mojo::shell::mojom::Shell* shell, 93 mojo::Shell* shell,
94 mus::Window* window) 94 mus::Window* window)
95 : NativeWidgetMus(delegate, 95 : NativeWidgetMus(delegate, shell, window,
96 shell,
97 window,
98 mus::mojom::SurfaceType::UNDERLAY) {} 96 mus::mojom::SurfaceType::UNDERLAY) {}
99 ~WmNativeWidgetMus() override { 97 ~WmNativeWidgetMus() override {
100 } 98 }
101 99
102 // NativeWidgetMus: 100 // NativeWidgetMus:
103 views::NonClientFrameView* CreateNonClientFrameView() override { 101 views::NonClientFrameView* CreateNonClientFrameView() override {
104 views::Widget* widget = 102 views::Widget* widget =
105 static_cast<views::internal::NativeWidgetPrivate*>(this)->GetWidget(); 103 static_cast<views::internal::NativeWidgetPrivate*>(this)->GetWidget();
106 NonClientFrameViewMash* frame_view = 104 NonClientFrameViewMash* frame_view =
107 new NonClientFrameViewMash(widget, window()); 105 new NonClientFrameViewMash(widget, window());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 159
162 private: 160 private:
163 NonClientFrameController* frame_controller_; 161 NonClientFrameController* frame_controller_;
164 162
165 DISALLOW_COPY_AND_ASSIGN(ClientViewMus); 163 DISALLOW_COPY_AND_ASSIGN(ClientViewMus);
166 }; 164 };
167 165
168 } // namespace 166 } // namespace
169 167
170 NonClientFrameController::NonClientFrameController( 168 NonClientFrameController::NonClientFrameController(
171 mojo::shell::mojom::Shell* shell, 169 mojo::Shell* shell,
172 mus::Window* window, 170 mus::Window* window,
173 mus::WindowManagerClient* window_manager_client) 171 mus::WindowManagerClient* window_manager_client)
174 : widget_(new views::Widget), window_(window) { 172 : widget_(new views::Widget), window_(window) {
175 window_->AddObserver(this); 173 window_->AddObserver(this);
176 174
177 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); 175 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
178 // We initiate focus at the mus level, not at the views level. 176 // We initiate focus at the mus level, not at the views level.
179 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; 177 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
180 params.delegate = this; 178 params.delegate = this;
181 params.native_widget = new WmNativeWidgetMus(widget_, shell, window); 179 params.native_widget = new WmNativeWidgetMus(widget_, shell, window);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 widget_->UpdateWindowTitle(); 250 widget_->UpdateWindowTitle();
253 } 251 }
254 252
255 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) { 253 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) {
256 window_->RemoveObserver(this); 254 window_->RemoveObserver(this);
257 window_ = nullptr; 255 window_ = nullptr;
258 } 256 }
259 257
260 } // namespace wm 258 } // namespace wm
261 } // namespace mash 259 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/non_client_frame_controller.h ('k') | mash/wm/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698