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

Side by Side Diff: ui/views/mus/aura_init.cc

Issue 2011833003: Implement ui::ClipboardMus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cast_linux. Created 4 years, 6 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 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 "ui/views/mus/aura_init.h" 5 #include "ui/views/mus/aura_init.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "services/catalog/public/cpp/resource_loader.h" 13 #include "services/catalog/public/cpp/resource_loader.h"
14 #include "services/shell/public/cpp/connector.h" 14 #include "services/shell/public/cpp/connector.h"
15 #include "ui/aura/env.h" 15 #include "ui/aura/env.h"
16 #include "ui/base/ime/input_method_initializer.h" 16 #include "ui/base/ime/input_method_initializer.h"
17 #include "ui/base/material_design/material_design_controller.h" 17 #include "ui/base/material_design/material_design_controller.h"
18 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/base/ui_base_paths.h" 19 #include "ui/base/ui_base_paths.h"
20 #include "ui/views/mus/clipboard_mus.h"
20 #include "ui/views/views_delegate.h" 21 #include "ui/views/views_delegate.h"
21 22
22 #if defined(OS_LINUX) && !defined(OS_ANDROID) 23 #if defined(OS_LINUX) && !defined(OS_ANDROID)
23 #include "components/font_service/public/cpp/font_loader.h" 24 #include "components/font_service/public/cpp/font_loader.h"
24 #endif 25 #endif
25 26
26 namespace views { 27 namespace views {
27 28
28 namespace { 29 namespace {
29 30
(...skipping 22 matching lines...) Expand all
52 } // namespace 53 } // namespace
53 54
54 AuraInit::AuraInit(shell::Connector* connector, 55 AuraInit::AuraInit(shell::Connector* connector,
55 const std::string& resource_file) 56 const std::string& resource_file)
56 : resource_file_(resource_file), 57 : resource_file_(resource_file),
57 env_(aura::Env::CreateInstance()), 58 env_(aura::Env::CreateInstance()),
58 views_delegate_(new MusViewsDelegate) { 59 views_delegate_(new MusViewsDelegate) {
59 ui::MaterialDesignController::Initialize(); 60 ui::MaterialDesignController::Initialize();
60 InitializeResources(connector); 61 InitializeResources(connector);
61 62
63 std::unique_ptr<ClipboardMus> clipboard(new ClipboardMus);
64 clipboard->Init(connector);
65 ui::Clipboard::SetClipboardForCurrentThread(std::move(clipboard));
66
62 ui::InitializeInputMethodForTesting(); 67 ui::InitializeInputMethodForTesting();
63 } 68 }
64 69
65 AuraInit::~AuraInit() { 70 AuraInit::~AuraInit() {
66 #if defined(OS_LINUX) && !defined(OS_ANDROID) 71 #if defined(OS_LINUX) && !defined(OS_ANDROID)
67 if (font_loader_.get()) { 72 if (font_loader_.get()) {
68 SkFontConfigInterface::SetGlobal(nullptr); 73 SkFontConfigInterface::SetGlobal(nullptr);
69 // FontLoader is ref counted. We need to explicitly shutdown the background 74 // FontLoader is ref counted. We need to explicitly shutdown the background
70 // thread, otherwise the background thread may be shutdown after the app is 75 // thread, otherwise the background thread may be shutdown after the app is
71 // torn down, when we're in a bad state. 76 // torn down, when we're in a bad state.
(...skipping 23 matching lines...) Expand all
95 font_loader_ = sk_make_sp<font_service::FontLoader>(connector); 100 font_loader_ = sk_make_sp<font_service::FontLoader>(connector);
96 SkFontConfigInterface::SetGlobal(font_loader_.get()); 101 SkFontConfigInterface::SetGlobal(font_loader_.get());
97 #endif 102 #endif
98 103
99 // There is a bunch of static state in gfx::Font, by running this now, 104 // There is a bunch of static state in gfx::Font, by running this now,
100 // before any other apps load, we ensure all the state is set up. 105 // before any other apps load, we ensure all the state is set up.
101 gfx::Font(); 106 gfx::Font();
102 } 107 }
103 108
104 } // namespace views 109 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698