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

Side by Side Diff: ui/wm/test/wm_test_helper.h

Issue 2207043002: SetDeviceScaleFactorForTest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetDeviceScaleFactorForTest 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef UI_WM_TEST_WM_TEST_HELPER_H_ 5 #ifndef UI_WM_TEST_WM_TEST_HELPER_H_
6 #define UI_WM_TEST_WM_TEST_HELPER_H_ 6 #define UI_WM_TEST_WM_TEST_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/aura/client/window_tree_client.h" 12 #include "ui/aura/client/window_tree_client.h"
13 #include "ui/aura/test/test_screen.h"
13 #include "ui/aura/window_tree_host.h" 14 #include "ui/aura/window_tree_host.h"
14 15
15 namespace aura { 16 namespace aura {
16 class InputMethodGlue; 17 class InputMethodGlue;
17 class Window; 18 class Window;
18 class WindowTreeHost; 19 class WindowTreeHost;
19 namespace client { 20 namespace client {
20 class DefaultCaptureClient; 21 class DefaultCaptureClient;
21 class FocusClient; 22 class FocusClient;
22 } 23 }
(...skipping 14 matching lines...) Expand all
37 38
38 // Creates a minimal environment for running the shell. We can't pull in all of 39 // Creates a minimal environment for running the shell. We can't pull in all of
39 // ash here, but we can create attach several of the same things we'd find in 40 // ash here, but we can create attach several of the same things we'd find in
40 // the ash parts of the code. 41 // the ash parts of the code.
41 class WMTestHelper : public aura::client::WindowTreeClient { 42 class WMTestHelper : public aura::client::WindowTreeClient {
42 public: 43 public:
43 WMTestHelper(const gfx::Size& default_window_size, 44 WMTestHelper(const gfx::Size& default_window_size,
44 ui::ContextFactory* context_factory); 45 ui::ContextFactory* context_factory);
45 ~WMTestHelper() override; 46 ~WMTestHelper() override;
46 47
47 aura::WindowTreeHost* host() { return host_.get(); } 48 aura::WindowTreeHost* host() { return test_screen_->host(); }
48 49
49 // Overridden from client::WindowTreeClient: 50 // Overridden from client::WindowTreeClient:
50 aura::Window* GetDefaultParent(aura::Window* context, 51 aura::Window* GetDefaultParent(aura::Window* context,
51 aura::Window* window, 52 aura::Window* window,
52 const gfx::Rect& bounds) override; 53 const gfx::Rect& bounds) override;
53 54
54 private: 55 private:
55 std::unique_ptr<aura::WindowTreeHost> host_; 56 std::unique_ptr<aura::TestScreen> test_screen_;
56 std::unique_ptr<aura::InputMethodGlue> input_method_glue_; 57 std::unique_ptr<aura::InputMethodGlue> input_method_glue_;
57 std::unique_ptr<wm::CompoundEventFilter> root_window_event_filter_; 58 std::unique_ptr<wm::CompoundEventFilter> root_window_event_filter_;
58 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_; 59 std::unique_ptr<aura::client::DefaultCaptureClient> capture_client_;
59 std::unique_ptr<aura::client::FocusClient> focus_client_; 60 std::unique_ptr<aura::client::FocusClient> focus_client_;
60 61
61 DISALLOW_COPY_AND_ASSIGN(WMTestHelper); 62 DISALLOW_COPY_AND_ASSIGN(WMTestHelper);
62 }; 63 };
63 64
64 } // namespace wm 65 } // namespace wm
65 66
66 #endif // UI_WM_TEST_WM_TEST_HELPER_H_ 67 #endif // UI_WM_TEST_WM_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « ui/views_content_client/views_content_client_main_parts_chromeos.cc ('k') | ui/wm/test/wm_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698