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

Unified Diff: ash/mus/window_manager.cc

Issue 2904993003: chromeos: changes how DisplayManagerObservers are notified (Closed)
Patch Set: cleanup Created 3 years, 7 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 | « ash/mus/window_manager.h ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index b9ea19ffd9acbc2c53ecfacc424a3850b8998d45..08d115ca611e820a7ef56f23d6da32552eeaee50 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -126,30 +126,22 @@ void WindowManager::Init(
DCHECK_EQ(nullptr, ash::Shell::window_tree_client());
ash::Shell::set_window_tree_client(window_tree_client_.get());
- // TODO(sky): remove and use MUS code.
+ // TODO(sky): remove and use MUS code. This should really be
+ // ShouldEnableSimplifiedDisplayManagement(), but as ShellPort hasn't been
+ // created yet it can't be used here.
if (config_ == Config::MASH) {
// |connector_| is null in some tests.
if (connector_)
connector_->BindInterface(ui::mojom::kServiceName, &display_controller_);
screen_ = base::MakeUnique<ScreenMus>(display_controller_.get());
display::Screen::SetScreenInstance(screen_.get());
+ InstallFrameDecorationValues();
}
pointer_watcher_event_router_ =
base::MakeUnique<views::PointerWatcherEventRouter>(
window_tree_client_.get());
- ui::mojom::FrameDecorationValuesPtr frame_decoration_values =
- ui::mojom::FrameDecorationValues::New();
- const gfx::Insets client_area_insets =
- NonClientFrameController::GetPreferredClientAreaInsets();
- frame_decoration_values->normal_client_area_insets = client_area_insets;
- frame_decoration_values->maximized_client_area_insets = client_area_insets;
- frame_decoration_values->max_title_bar_button_width =
- NonClientFrameController::GetMaxTitleBarButtonWidth();
- window_manager_client_->SetFrameDecorationValues(
- std::move(frame_decoration_values));
-
// Notify PointerWatcherEventRouter and CaptureSynchronizer that the capture
// client has been set.
aura::client::CaptureClient* capture_client = wm_state_->capture_controller();
@@ -261,6 +253,19 @@ void WindowManager::CreateAndRegisterRootWindowController(
root_window_controllers_.insert(std::move(root_window_controller));
}
+void WindowManager::InstallFrameDecorationValues() {
+ ui::mojom::FrameDecorationValuesPtr frame_decoration_values =
+ ui::mojom::FrameDecorationValues::New();
+ const gfx::Insets client_area_insets =
+ NonClientFrameController::GetPreferredClientAreaInsets();
+ frame_decoration_values->normal_client_area_insets = client_area_insets;
+ frame_decoration_values->maximized_client_area_insets = client_area_insets;
+ frame_decoration_values->max_title_bar_button_width =
+ NonClientFrameController::GetMaxTitleBarButtonWidth();
+ window_manager_client_->SetFrameDecorationValues(
+ std::move(frame_decoration_values));
+}
+
void WindowManager::DestroyRootWindowController(
RootWindowController* root_window_controller,
bool in_shutdown) {
@@ -341,6 +346,7 @@ void WindowManager::OnWmConnected() {
CreateShell(nullptr);
if (show_primary_host_on_connect_)
Shell::GetPrimaryRootWindow()->GetHost()->Show();
+ InstallFrameDecorationValues();
}
void WindowManager::OnWmSetBounds(aura::Window* window,
« no previous file with comments | « ash/mus/window_manager.h ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698