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

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

Issue 1492323003: Updates shadow when active window changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years 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/BUILD.gn ('k') | mash/wm/property_util.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 "components/mus/public/cpp/window.h" 7 #include "components/mus/public/cpp/window.h"
8 #include "components/mus/public/interfaces/window_tree_host.mojom.h" 8 #include "components/mus/public/interfaces/window_tree_host.mojom.h"
9 #include "mash/wm/frame/frame_border_hit_test_controller.h" 9 #include "mash/wm/frame/frame_border_hit_test_controller.h"
10 #include "mash/wm/frame/move_event_handler.h" 10 #include "mash/wm/frame/move_event_handler.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 aura::Window* root_window = GetNativeView()->GetHost()->window(); 110 aura::Window* root_window = GetNativeView()->GetHost()->window();
111 move_event_handler_.reset(new MoveEventHandler(window(), GetNativeView())); 111 move_event_handler_.reset(new MoveEventHandler(window(), GetNativeView()));
112 root_window->AddPreTargetHandler(move_event_handler_.get()); 112 root_window->AddPreTargetHandler(move_event_handler_.get());
113 return frame_view; 113 return frame_view;
114 } 114 }
115 void InitNativeWidget(const views::Widget::InitParams& params) override { 115 void InitNativeWidget(const views::Widget::InitParams& params) override {
116 views::NativeWidgetMus::InitNativeWidget(params); 116 views::NativeWidgetMus::InitNativeWidget(params);
117 aura::WindowTreeHost* window_tree_host = GetNativeView()->GetHost(); 117 aura::WindowTreeHost* window_tree_host = GetNativeView()->GetHost();
118 // TODO(sky): shadow should be determined by window type. 118 // TODO(sky): shadow should be determined by window type.
119 shadow_.reset(new Shadow); 119 shadow_.reset(new Shadow);
120 shadow_->Init(Shadow::STYLE_ACTIVE); 120 shadow_->Init(Shadow::STYLE_INACTIVE);
121 SetShadow(window(), shadow_.get());
121 ContentWindowLayoutManager* layout_manager = new ContentWindowLayoutManager( 122 ContentWindowLayoutManager* layout_manager = new ContentWindowLayoutManager(
122 window_tree_host->window(), ShadowStyle::NORMAL, shadow_.get()); 123 window_tree_host->window(), ShadowStyle::NORMAL, shadow_.get());
123 window_tree_host->window()->SetLayoutManager(layout_manager); 124 window_tree_host->window()->SetLayoutManager(layout_manager);
124 const int inset = Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); 125 const int inset = Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE);
125 window_tree_host->SetOutputSurfacePadding( 126 window_tree_host->SetOutputSurfacePadding(
126 gfx::Insets(inset, inset, inset, inset)); 127 gfx::Insets(inset, inset, inset, inset));
127 window_tree_host->window()->layer()->Add(shadow_->layer()); 128 window_tree_host->window()->layer()->Add(shadow_->layer());
128 shadow_->layer()->parent()->StackAtBottom(shadow_->layer()); 129 shadow_->layer()->parent()->StackAtBottom(shadow_->layer());
129 } 130 }
130 void CenterWindow(const gfx::Size& size) override { 131 void CenterWindow(const gfx::Size& size) override {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 widget_->OnSizeConstraintsChanged(); 216 widget_->OnSizeConstraintsChanged();
216 } 217 }
217 218
218 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) { 219 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) {
219 window_->RemoveObserver(this); 220 window_->RemoveObserver(this);
220 window_ = nullptr; 221 window_ = nullptr;
221 } 222 }
222 223
223 } // namespace wm 224 } // namespace wm
224 } // namespace mash 225 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/BUILD.gn ('k') | mash/wm/property_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698