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

Side by Side Diff: ash/common/wm/workspace/workspace_layout_manager_unittest.cc

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge Created 3 years, 9 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 | « ash/common/wm/workspace/workspace_layout_manager.cc ('k') | ash/common/wm_shell.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/common/wm/workspace/workspace_layout_manager.h" 5 #include "ash/common/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/shelf/shelf_constants.h" 11 #include "ash/common/shelf/shelf_constants.h"
12 #include "ash/common/shelf/shelf_layout_manager.h" 12 #include "ash/common/shelf/shelf_layout_manager.h"
13 #include "ash/common/shelf/wm_shelf.h" 13 #include "ash/common/shelf/wm_shelf.h"
14 #include "ash/common/shell_observer.h" 14 #include "ash/common/shell_observer.h"
15 #include "ash/common/test/ash_test.h" 15 #include "ash/common/test/ash_test.h"
16 #include "ash/common/test/test_session_state_delegate.h" 16 #include "ash/common/test/test_session_state_delegate.h"
17 #include "ash/common/wm/fullscreen_window_finder.h" 17 #include "ash/common/wm/fullscreen_window_finder.h"
18 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" 18 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h"
19 #include "ash/common/wm/window_state.h" 19 #include "ash/common/wm/window_state.h"
20 #include "ash/common/wm/wm_event.h" 20 #include "ash/common/wm/wm_event.h"
21 #include "ash/common/wm/wm_screen_util.h" 21 #include "ash/common/wm/wm_screen_util.h"
22 #include "ash/common/wm/workspace/workspace_window_resizer.h" 22 #include "ash/common/wm/workspace/workspace_window_resizer.h"
23 #include "ash/common/wm_shell.h" 23 #include "ash/common/wm_shell.h"
24 #include "ash/common/wm_window.h" 24 #include "ash/common/wm_window.h"
25 #include "ash/public/cpp/shell_window_ids.h" 25 #include "ash/public/cpp/shell_window_ids.h"
26 #include "ash/root_window_controller.h" 26 #include "ash/root_window_controller.h"
27 #include "ash/shell.h"
27 #include "ash/wm/window_state_aura.h" 28 #include "ash/wm/window_state_aura.h"
28 #include "base/command_line.h" 29 #include "base/command_line.h"
29 #include "base/run_loop.h" 30 #include "base/run_loop.h"
30 #include "ui/aura/env.h" 31 #include "ui/aura/env.h"
31 #include "ui/base/ui_base_switches.h" 32 #include "ui/base/ui_base_switches.h"
32 #include "ui/base/ui_base_types.h" 33 #include "ui/base/ui_base_types.h"
33 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 34 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
34 #include "ui/display/display.h" 35 #include "ui/display/display.h"
35 #include "ui/display/screen.h" 36 #include "ui/display/screen.h"
36 #include "ui/gfx/geometry/insets.h" 37 #include "ui/gfx/geometry/insets.h"
(...skipping 19 matching lines...) Expand all
56 57
57 private: 58 private:
58 const gfx::Rect initial_bounds_; 59 const gfx::Rect initial_bounds_;
59 60
60 DISALLOW_COPY_AND_ASSIGN(MaximizeDelegateView); 61 DISALLOW_COPY_AND_ASSIGN(MaximizeDelegateView);
61 }; 62 };
62 63
63 class TestShellObserver : public ShellObserver { 64 class TestShellObserver : public ShellObserver {
64 public: 65 public:
65 TestShellObserver() : call_count_(0), is_fullscreen_(false) { 66 TestShellObserver() : call_count_(0), is_fullscreen_(false) {
66 WmShell::Get()->AddShellObserver(this); 67 Shell::GetInstance()->AddShellObserver(this);
67 } 68 }
68 69
69 ~TestShellObserver() override { WmShell::Get()->RemoveShellObserver(this); } 70 ~TestShellObserver() override {
71 Shell::GetInstance()->RemoveShellObserver(this);
72 }
70 73
71 void OnFullscreenStateChanged(bool is_fullscreen, 74 void OnFullscreenStateChanged(bool is_fullscreen,
72 WmWindow* root_window) override { 75 WmWindow* root_window) override {
73 call_count_++; 76 call_count_++;
74 is_fullscreen_ = is_fullscreen; 77 is_fullscreen_ = is_fullscreen;
75 } 78 }
76 79
77 int call_count() const { return call_count_; } 80 int call_count() const { return call_count_; }
78 81
79 bool is_fullscreen() const { return is_fullscreen_; } 82 bool is_fullscreen() const { return is_fullscreen_; }
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 window->SetBounds(keyboard_bounds()); 1262 window->SetBounds(keyboard_bounds());
1260 window->GetWindowState()->set_ignore_keyboard_bounds_change(true); 1263 window->GetWindowState()->set_ignore_keyboard_bounds_change(true);
1261 window->Activate(); 1264 window->Activate();
1262 1265
1263 EXPECT_EQ(keyboard_bounds(), window->GetBounds()); 1266 EXPECT_EQ(keyboard_bounds(), window->GetBounds());
1264 ShowKeyboard(); 1267 ShowKeyboard();
1265 EXPECT_EQ(keyboard_bounds(), window->GetBounds()); 1268 EXPECT_EQ(keyboard_bounds(), window->GetBounds());
1266 } 1269 }
1267 1270
1268 } // namespace ash 1271 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/workspace/workspace_layout_manager.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698