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 #ifndef UI_VIEWS_MUS_AURA_INIT_H_ | 5 #ifndef UI_VIEWS_MUS_AURA_INIT_H_ |
6 #define UI_VIEWS_MUS_AURA_INIT_H_ | 6 #define UI_VIEWS_MUS_AURA_INIT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const service_manager::Identity& identity, | 58 const service_manager::Identity& identity, |
59 const std::string& resource_file, | 59 const std::string& resource_file, |
60 const std::string& resource_file_200 = std::string(), | 60 const std::string& resource_file_200 = std::string(), |
61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr, | 61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr, |
62 Mode mode = Mode::UI); | 62 Mode mode = Mode::UI); |
63 ~AuraInit(); | 63 ~AuraInit(); |
64 | 64 |
65 // Only valid if Mode::AURA_MUS was passed to constructor. | 65 // Only valid if Mode::AURA_MUS was passed to constructor. |
66 MusClient* mus_client() { return mus_client_.get(); } | 66 MusClient* mus_client() { return mus_client_.get(); } |
67 | 67 |
| 68 // Returns true if AuraInit was able to successfully complete initialization. |
| 69 // If this returns false, then Aura is in an unusable state, and calling |
| 70 // services should shutdown. |
| 71 bool initialized() { return initialized_; } |
| 72 |
68 private: | 73 private: |
69 void InitializeResources(service_manager::Connector* connector); | 74 bool InitializeResources(service_manager::Connector* connector); |
70 | 75 |
71 #if defined(OS_LINUX) | 76 #if defined(OS_LINUX) |
72 sk_sp<font_service::FontLoader> font_loader_; | 77 sk_sp<font_service::FontLoader> font_loader_; |
73 #endif | 78 #endif |
74 | 79 |
75 const std::string resource_file_; | 80 const std::string resource_file_; |
76 const std::string resource_file_200_; | 81 const std::string resource_file_200_; |
77 | 82 |
78 std::unique_ptr<aura::Env> env_; | 83 std::unique_ptr<aura::Env> env_; |
79 std::unique_ptr<MusClient> mus_client_; | 84 std::unique_ptr<MusClient> mus_client_; |
80 std::unique_ptr<ViewsDelegate> views_delegate_; | 85 std::unique_ptr<ViewsDelegate> views_delegate_; |
81 | 86 |
| 87 // Whether or not initialization succeeds. |
| 88 bool initialized_ = false; |
| 89 |
82 DISALLOW_COPY_AND_ASSIGN(AuraInit); | 90 DISALLOW_COPY_AND_ASSIGN(AuraInit); |
83 }; | 91 }; |
84 | 92 |
85 } // namespace views | 93 } // namespace views |
86 | 94 |
87 #endif // UI_VIEWS_MUS_AURA_INIT_H_ | 95 #endif // UI_VIEWS_MUS_AURA_INIT_H_ |
OLD | NEW |