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

Side by Side Diff: components/exo/wayland/server.cc

Issue 2218973003: Initialize layout_mode with the current value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 "components/exo/wayland/server.h" 5 #include "components/exo/wayland/server.h"
6 6
7 #include <grp.h> 7 #include <grp.h>
8 #include <linux/input.h> 8 #include <linux/input.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 12 matching lines...) Expand all
23 23
24 #include <algorithm> 24 #include <algorithm>
25 #include <cstdlib> 25 #include <cstdlib>
26 #include <iterator> 26 #include <iterator>
27 #include <string> 27 #include <string>
28 #include <utility> 28 #include <utility>
29 29
30 #include "ash/common/display/display_info.h" 30 #include "ash/common/display/display_info.h"
31 #include "ash/common/shell_observer.h" 31 #include "ash/common/shell_observer.h"
32 #include "ash/common/shell_window_ids.h" 32 #include "ash/common/shell_window_ids.h"
33 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
33 #include "ash/common/wm_shell.h" 34 #include "ash/common/wm_shell.h"
34 #include "ash/display/display_manager.h" 35 #include "ash/display/display_manager.h"
35 #include "ash/shell.h" 36 #include "ash/shell.h"
36 #include "base/bind.h" 37 #include "base/bind.h"
37 #include "base/cancelable_callback.h" 38 #include "base/cancelable_callback.h"
38 #include "base/files/file_path.h" 39 #include "base/files/file_path.h"
39 #include "base/macros.h" 40 #include "base/macros.h"
40 #include "base/memory/free_deleter.h" 41 #include "base/memory/free_deleter.h"
41 #include "base/memory/ptr_util.h" 42 #include "base/memory/ptr_util.h"
42 #include "base/memory/weak_ptr.h" 43 #include "base/memory/weak_ptr.h"
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 public: 1579 public:
1579 WaylandRemoteShell(Display* display, 1580 WaylandRemoteShell(Display* display,
1580 wl_resource* remote_shell_resource) 1581 wl_resource* remote_shell_resource)
1581 : display_(display), 1582 : display_(display),
1582 remote_shell_resource_(remote_shell_resource), 1583 remote_shell_resource_(remote_shell_resource),
1583 weak_ptr_factory_(this) { 1584 weak_ptr_factory_(this) {
1584 ash::WmShell::Get()->AddShellObserver(this); 1585 ash::WmShell::Get()->AddShellObserver(this);
1585 ash::Shell* shell = ash::Shell::GetInstance(); 1586 ash::Shell* shell = ash::Shell::GetInstance();
1586 shell->activation_client()->AddObserver(this); 1587 shell->activation_client()->AddObserver(this);
1587 display::Screen::GetScreen()->AddObserver(this); 1588 display::Screen::GetScreen()->AddObserver(this);
1589
1590 layout_mode_ = ash::WmShell::Get()
1591 ->maximize_mode_controller()
1592 ->IsMaximizeModeWindowManagerEnabled()
1593 ? ZWP_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET
1594 : ZWP_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED;
1595
1588 SendPrimaryDisplayMetrics(); 1596 SendPrimaryDisplayMetrics();
1589 SendActivated(shell->activation_client()->GetActiveWindow(), nullptr); 1597 SendActivated(shell->activation_client()->GetActiveWindow(), nullptr);
1590 } 1598 }
1591 ~WaylandRemoteShell() override { 1599 ~WaylandRemoteShell() override {
1592 ash::WmShell::Get()->RemoveShellObserver(this); 1600 ash::WmShell::Get()->RemoveShellObserver(this);
1593 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); 1601 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
1594 display::Screen::GetScreen()->RemoveObserver(this); 1602 display::Screen::GetScreen()->RemoveObserver(this);
1595 } 1603 }
1596 1604
1597 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface, 1605 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface,
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
3125 DCHECK(event_loop); 3133 DCHECK(event_loop);
3126 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3134 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3127 } 3135 }
3128 3136
3129 void Server::Flush() { 3137 void Server::Flush() {
3130 wl_display_flush_clients(wl_display_.get()); 3138 wl_display_flush_clients(wl_display_.get());
3131 } 3139 }
3132 3140
3133 } // namespace wayland 3141 } // namespace wayland
3134 } // namespace exo 3142 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698