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

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

Issue 2223973002: Initialize layout_mode with the current value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
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 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 public: 1580 public:
1580 WaylandRemoteShell(Display* display, 1581 WaylandRemoteShell(Display* display,
1581 wl_resource* remote_shell_resource) 1582 wl_resource* remote_shell_resource)
1582 : display_(display), 1583 : display_(display),
1583 remote_shell_resource_(remote_shell_resource), 1584 remote_shell_resource_(remote_shell_resource),
1584 weak_ptr_factory_(this) { 1585 weak_ptr_factory_(this) {
1585 ash::WmShell::Get()->AddShellObserver(this); 1586 ash::WmShell::Get()->AddShellObserver(this);
1586 ash::Shell* shell = ash::Shell::GetInstance(); 1587 ash::Shell* shell = ash::Shell::GetInstance();
1587 shell->activation_client()->AddObserver(this); 1588 shell->activation_client()->AddObserver(this);
1588 display::Screen::GetScreen()->AddObserver(this); 1589 display::Screen::GetScreen()->AddObserver(this);
1590
1591 layout_mode_ = ash::WmShell::Get()
1592 ->maximize_mode_controller()
1593 ->IsMaximizeModeWindowManagerEnabled()
1594 ? ZWP_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET
1595 : ZWP_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED;
1596
1589 SendPrimaryDisplayMetrics(); 1597 SendPrimaryDisplayMetrics();
1590 SendActivated(shell->activation_client()->GetActiveWindow(), nullptr); 1598 SendActivated(shell->activation_client()->GetActiveWindow(), nullptr);
1591 } 1599 }
1592 ~WaylandRemoteShell() override { 1600 ~WaylandRemoteShell() override {
1593 ash::WmShell::Get()->RemoveShellObserver(this); 1601 ash::WmShell::Get()->RemoveShellObserver(this);
1594 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this); 1602 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
1595 display::Screen::GetScreen()->RemoveObserver(this); 1603 display::Screen::GetScreen()->RemoveObserver(this);
1596 } 1604 }
1597 1605
1598 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface, 1606 std::unique_ptr<ShellSurface> CreateShellSurface(Surface* surface,
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
3131 DCHECK(event_loop); 3139 DCHECK(event_loop);
3132 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 3140 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
3133 } 3141 }
3134 3142
3135 void Server::Flush() { 3143 void Server::Flush() {
3136 wl_display_flush_clients(wl_display_.get()); 3144 wl_display_flush_clients(wl_display_.get());
3137 } 3145 }
3138 3146
3139 } // namespace wayland 3147 } // namespace wayland
3140 } // namespace exo 3148 } // 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