| OLD | NEW |
| 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/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "services/catalog/public/cpp/resource_loader.h" | 14 #include "services/catalog/public/cpp/resource_loader.h" |
| 15 #include "services/catalog/public/interfaces/constants.mojom.h" | 15 #include "services/catalog/public/interfaces/constants.mojom.h" |
| 16 #include "services/service_manager/public/cpp/connector.h" | 16 #include "services/service_manager/public/cpp/connector.h" |
| 17 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
| 18 #include "ui/base/ime/input_method_initializer.h" | 18 #include "ui/base/ime/input_method_initializer.h" |
| 19 #include "ui/base/material_design/material_design_controller.h" | 19 #include "ui/base/material_design/material_design_controller.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 21 #include "ui/base/ui_base_paths.h" | 21 #include "ui/base/ui_base_paths.h" |
| 22 #include "ui/views/layout/layout_provider.h" |
| 22 #include "ui/views/mus/mus_client.h" | 23 #include "ui/views/mus/mus_client.h" |
| 23 #include "ui/views/style/typography_provider.h" | 24 #include "ui/views/style/typography_provider.h" |
| 24 #include "ui/views/views_delegate.h" | 25 #include "ui/views/views_delegate.h" |
| 25 | 26 |
| 26 #if defined(OS_LINUX) | 27 #if defined(OS_LINUX) |
| 27 #include "components/font_service/public/cpp/font_loader.h" | 28 #include "components/font_service/public/cpp/font_loader.h" |
| 28 #endif | 29 #endif |
| 29 | 30 |
| 30 namespace views { | 31 namespace views { |
| 31 | 32 |
| 32 namespace { | 33 namespace { |
| 33 | 34 |
| 34 class MusViewsDelegate : public ViewsDelegate { | 35 class MusViewsDelegate : public ViewsDelegate { |
| 35 public: | 36 public: |
| 36 MusViewsDelegate() {} | 37 MusViewsDelegate() {} |
| 37 ~MusViewsDelegate() override {} | 38 ~MusViewsDelegate() override {} |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 41 HICON GetSmallWindowIcon() const override { return nullptr; } | 42 HICON GetSmallWindowIcon() const override { return nullptr; } |
| 42 #endif | 43 #endif |
| 43 void OnBeforeWidgetInit( | 44 void OnBeforeWidgetInit( |
| 44 Widget::InitParams* params, | 45 Widget::InitParams* params, |
| 45 internal::NativeWidgetDelegate* delegate) override {} | 46 internal::NativeWidgetDelegate* delegate) override {} |
| 46 | 47 |
| 47 const TypographyProvider& GetTypographyProvider() const override { | 48 LayoutProvider layout_provider_; |
| 48 return typography_provider_; | |
| 49 } | |
| 50 | |
| 51 DefaultTypographyProvider typography_provider_; | |
| 52 | 49 |
| 53 DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate); |
| 54 }; | 51 }; |
| 55 | 52 |
| 56 } // namespace | 53 } // namespace |
| 57 | 54 |
| 58 AuraInit::AuraInit(service_manager::Connector* connector, | 55 AuraInit::AuraInit(service_manager::Connector* connector, |
| 59 const service_manager::Identity& identity, | 56 const service_manager::Identity& identity, |
| 60 const std::string& resource_file, | 57 const std::string& resource_file, |
| 61 const std::string& resource_file_200, | 58 const std::string& resource_file_200, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( | 117 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( |
| 121 std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile); | 118 std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile); |
| 122 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 119 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
| 123 std::move(pak_file_2), ui::SCALE_FACTOR_100P); | 120 std::move(pak_file_2), ui::SCALE_FACTOR_100P); |
| 124 if (!resource_file_200_.empty()) | 121 if (!resource_file_200_.empty()) |
| 125 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 122 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
| 126 loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P); | 123 loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P); |
| 127 } | 124 } |
| 128 | 125 |
| 129 } // namespace views | 126 } // namespace views |
| OLD | NEW |