Reland "Add InitParams for views::AuraInit"
This reverts commite959c2d741
. Fixed by adding EXPORT macro on the new struct. Original change's description: > Revert "Add InitParams for views::AuraInit" > > This reverts commitdfd53f1153
. > > Reason for revert: GPU FYI Windows bots compile failure > crbug.com/854442 > > Compile error: > [40824/45748] LINK task_viewer.service.exe task_viewer.service.exe.pdb > FAILED: task_viewer.service.exe task_viewer.service.exe.pdb > C:/b/swarming/w/ir/cache/vpython/80ee9f/Scripts/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo /OUT:./task_viewer.service.exe /PDB:./task_viewer.service.exe.pdb @./task_viewer.service.exe.rsp > C:\b\swarming\w\ir\cache\builder\src\third_party\llvm-build\Release+Asserts\bin\lld-link.exe: error: undefined symbol: ??0InitParams@AuraInit@views@@QEAA@XZ > >>> referenced by obj/mash/task_viewer/lib/task_viewer.obj:(?OnStart@TaskViewer@task_viewer@mash@@EEAAXXZ) > C:\b\swarming\w\ir\cache\builder\src\third_party\llvm-build\Release+Asserts\bin\lld-link.exe: error: undefined symbol: ??1InitParams@AuraInit@views@@QEAA@XZ > >>> referenced by obj/mash/task_viewer/lib/task_viewer.obj:(?OnStart@TaskViewer@task_viewer@mash@@EEAAXXZ) > > Original change's description: > > Add InitParams for views::AuraInit > > > > It's up to 7 parameters and I'm about to add an 8th. > > > > Bug: 851578 > > Test: existing tests > > Change-Id: I5dbfb98c90861a334ef9046cec4d69fb756879a1 > > Reviewed-on: https://chromium-review.googlesource.com/1106431 > > Reviewed-by: Scott Violet <sky@chromium.org> > > Commit-Queue: James Cook <jamescook@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#568594} > > TBR=jamescook@chromium.org,sky@chromium.org > > Change-Id: Iea7d59178394a95cbc6f419cd7079d00d66a8ac6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 851578, 854442 > Reviewed-on: https://chromium-review.googlesource.com/1107139 > Reviewed-by: weiliangc <weiliangc@chromium.org> > Commit-Queue: weiliangc <weiliangc@chromium.org> > Cr-Commit-Position: refs/heads/master@{#568678} TBR=jamescook@chromium.org,sky@chromium.org,weiliangc@chromium.org Change-Id: Id0a3e75d0e02c87165375ecc345553041ecc4252 Bug: 851578, 854442 Reviewed-on: https://chromium-review.googlesource.com/1107997 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Commit-Queue: James Cook <jamescook@chromium.org> Cr-Commit-Position: refs/heads/master@{#568862}
This commit is contained in:
ash
mash
catalog_viewer
example
simple_wm
task_viewer
ui/views/mus
@@ -93,11 +93,12 @@ AutoclickApplication::AutoclickApplication()
|
|||||||
AutoclickApplication::~AutoclickApplication() = default;
|
AutoclickApplication::~AutoclickApplication() = default;
|
||||||
|
|
||||||
void AutoclickApplication::OnStart() {
|
void AutoclickApplication::OnStart() {
|
||||||
const bool register_path_provider = running_standalone_;
|
views::AuraInit::InitParams params;
|
||||||
aura_init_ = views::AuraInit::Create(
|
params.connector = context()->connector();
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.identity = context()->identity();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS,
|
params.mode = views::AuraInit::Mode::AURA_MUS;
|
||||||
register_path_provider);
|
params.register_path_provider = running_standalone_;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_) {
|
if (!aura_init_) {
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
return;
|
return;
|
||||||
|
@@ -174,11 +174,12 @@ void QuickLaunchApplication::OnStart() {
|
|||||||
// If AuraInit was unable to initialize there is no longer a peer connection.
|
// If AuraInit was unable to initialize there is no longer a peer connection.
|
||||||
// The ServiceManager is in the process of shutting down, however we haven't
|
// The ServiceManager is in the process of shutting down, however we haven't
|
||||||
// been notified yet. Close our ServiceContext and shutdown.
|
// been notified yet. Close our ServiceContext and shutdown.
|
||||||
const bool register_path_provider = running_standalone_;
|
views::AuraInit::InitParams params;
|
||||||
aura_init_ = views::AuraInit::Create(
|
params.connector = context()->connector();
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.identity = context()->identity();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS2,
|
params.mode = views::AuraInit::Mode::AURA_MUS2;
|
||||||
register_path_provider);
|
params.register_path_provider = running_standalone_;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_) {
|
if (!aura_init_) {
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
return;
|
return;
|
||||||
|
@@ -33,10 +33,12 @@ void ShortcutViewerApplication::RegisterForTraceEvents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ShortcutViewerApplication::OnStart() {
|
void ShortcutViewerApplication::OnStart() {
|
||||||
aura_init_ = views::AuraInit::Create(
|
views::AuraInit::InitParams params;
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.connector = context()->connector();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS2,
|
params.identity = context()->identity();
|
||||||
false /*register_path_provider*/);
|
params.mode = views::AuraInit::Mode::AURA_MUS2;
|
||||||
|
params.register_path_provider = false;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_) {
|
if (!aura_init_) {
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
return;
|
return;
|
||||||
|
@@ -45,11 +45,12 @@ void TapVisualizerApp::Start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TapVisualizerApp::OnStart() {
|
void TapVisualizerApp::OnStart() {
|
||||||
const bool register_path_provider = false;
|
views::AuraInit::InitParams params;
|
||||||
aura_init_ = views::AuraInit::Create(
|
params.connector = context()->connector();
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.identity = context()->identity();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS2,
|
params.mode = views::AuraInit::Mode::AURA_MUS2;
|
||||||
register_path_provider);
|
params.register_path_provider = false;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_) {
|
if (!aura_init_) {
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
return;
|
return;
|
||||||
|
@@ -179,11 +179,14 @@ void WindowManagerService::OnStart() {
|
|||||||
registry_.AddInterface(base::BindRepeating(
|
registry_.AddInterface(base::BindRepeating(
|
||||||
&WindowManagerService::BindServiceFactory, base::Unretained(this)));
|
&WindowManagerService::BindServiceFactory, base::Unretained(this)));
|
||||||
|
|
||||||
const bool register_path_provider = running_standalone_;
|
views::AuraInit::InitParams params;
|
||||||
aura_init_ = views::AuraInit::Create(
|
params.connector = context()->connector();
|
||||||
context()->connector(), context()->identity(),
|
params.identity = context()->identity();
|
||||||
"ash_service_resources.pak", "ash_service_resources_200.pak", nullptr,
|
params.resource_file = "ash_service_resources.pak";
|
||||||
views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER, register_path_provider);
|
params.resource_file_200 = "ash_service_resources_200.pak";
|
||||||
|
params.mode = views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER;
|
||||||
|
params.register_path_provider = running_standalone_;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_) {
|
if (!aura_init_) {
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
return;
|
return;
|
||||||
|
@@ -222,9 +222,11 @@ void CatalogViewer::RemoveWindow(views::Widget* window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CatalogViewer::OnStart() {
|
void CatalogViewer::OnStart() {
|
||||||
aura_init_ = views::AuraInit::Create(
|
views::AuraInit::InitParams params;
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.connector = context()->connector();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
|
params.identity = context()->identity();
|
||||||
|
params.mode = views::AuraInit::Mode::AURA_MUS;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_)
|
if (!aura_init_)
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
}
|
}
|
||||||
|
@@ -31,10 +31,11 @@ class ViewsExamples : public service_manager::Service,
|
|||||||
private:
|
private:
|
||||||
// service_manager::Service:
|
// service_manager::Service:
|
||||||
void OnStart() override {
|
void OnStart() override {
|
||||||
aura_init_ =
|
views::AuraInit::InitParams params;
|
||||||
views::AuraInit::Create(context()->connector(), context()->identity(),
|
params.connector = context()->connector();
|
||||||
"views_mus_resources.pak", std::string(),
|
params.identity = context()->identity();
|
||||||
nullptr, views::AuraInit::Mode::AURA_MUS);
|
params.mode = views::AuraInit::Mode::AURA_MUS;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_)
|
if (!aura_init_)
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
}
|
}
|
||||||
|
@@ -453,9 +453,11 @@ void WindowTypeLauncher::RemoveWindow(views::Widget* window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WindowTypeLauncher::OnStart() {
|
void WindowTypeLauncher::OnStart() {
|
||||||
aura_init_ = views::AuraInit::Create(
|
views::AuraInit::InitParams params;
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.connector = context()->connector();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
|
params.identity = context()->identity();
|
||||||
|
params.mode = views::AuraInit::Mode::AURA_MUS;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_)
|
if (!aura_init_)
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
}
|
}
|
||||||
|
@@ -366,9 +366,11 @@ void SimpleWM::OnStart() {
|
|||||||
started_ = true;
|
started_ = true;
|
||||||
screen_ = std::make_unique<display::ScreenBase>();
|
screen_ = std::make_unique<display::ScreenBase>();
|
||||||
display::Screen::SetScreenInstance(screen_.get());
|
display::Screen::SetScreenInstance(screen_.get());
|
||||||
aura_init_ = views::AuraInit::Create(
|
views::AuraInit::InitParams params;
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.connector = context()->connector();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER);
|
params.identity = context()->identity();
|
||||||
|
params.mode = views::AuraInit::Mode::AURA_MUS_WINDOW_MANAGER;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_) {
|
if (!aura_init_) {
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
return;
|
return;
|
||||||
|
@@ -297,9 +297,11 @@ void TaskViewer::RemoveWindow(views::Widget* widget) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TaskViewer::OnStart() {
|
void TaskViewer::OnStart() {
|
||||||
aura_init_ = views::AuraInit::Create(
|
views::AuraInit::InitParams params;
|
||||||
context()->connector(), context()->identity(), "views_mus_resources.pak",
|
params.connector = context()->connector();
|
||||||
std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
|
params.identity = context()->identity();
|
||||||
|
params.mode = views::AuraInit::Mode::AURA_MUS;
|
||||||
|
aura_init_ = views::AuraInit::Create(params);
|
||||||
if (!aura_init_)
|
if (!aura_init_)
|
||||||
context()->QuitNow();
|
context()->QuitNow();
|
||||||
}
|
}
|
||||||
|
@@ -46,6 +46,10 @@ class MusViewsDelegate : public ViewsDelegate {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
AuraInit::InitParams::InitParams() : resource_file("views_mus_resources.pak") {}
|
||||||
|
|
||||||
|
AuraInit::InitParams::~InitParams() = default;
|
||||||
|
|
||||||
AuraInit::AuraInit() {
|
AuraInit::AuraInit() {
|
||||||
if (!ViewsDelegate::GetInstance())
|
if (!ViewsDelegate::GetInstance())
|
||||||
views_delegate_ = std::make_unique<MusViewsDelegate>();
|
views_delegate_ = std::make_unique<MusViewsDelegate>();
|
||||||
@@ -53,71 +57,53 @@ AuraInit::AuraInit() {
|
|||||||
|
|
||||||
AuraInit::~AuraInit() = default;
|
AuraInit::~AuraInit() = default;
|
||||||
|
|
||||||
std::unique_ptr<AuraInit> AuraInit::Create(
|
// static
|
||||||
service_manager::Connector* connector,
|
std::unique_ptr<AuraInit> AuraInit::Create(const InitParams& params) {
|
||||||
const service_manager::Identity& identity,
|
// Using 'new' to access a non-public constructor. go/totw/134
|
||||||
const std::string& resource_file,
|
|
||||||
const std::string& resource_file_200,
|
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
|
||||||
Mode mode,
|
|
||||||
bool register_path_provider) {
|
|
||||||
std::unique_ptr<AuraInit> aura_init = base::WrapUnique(new AuraInit());
|
std::unique_ptr<AuraInit> aura_init = base::WrapUnique(new AuraInit());
|
||||||
if (!aura_init->Init(connector, identity, resource_file, resource_file_200,
|
if (!aura_init->Init(params))
|
||||||
io_task_runner, mode, register_path_provider)) {
|
|
||||||
aura_init.reset();
|
aura_init.reset();
|
||||||
}
|
|
||||||
return aura_init;
|
return aura_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AuraInit::Init(service_manager::Connector* connector,
|
bool AuraInit::Init(const InitParams& params) {
|
||||||
const service_manager::Identity& identity,
|
|
||||||
const std::string& resource_file,
|
|
||||||
const std::string& resource_file_200,
|
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
|
||||||
Mode mode,
|
|
||||||
bool register_path_provider) {
|
|
||||||
env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS);
|
env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS);
|
||||||
|
|
||||||
if (mode == Mode::AURA_MUS || mode == Mode::AURA_MUS2) {
|
if (params.mode == Mode::AURA_MUS || params.mode == Mode::AURA_MUS2) {
|
||||||
MusClient::InitParams params;
|
MusClient::InitParams mus_params;
|
||||||
params.connector = connector;
|
mus_params.connector = params.connector;
|
||||||
params.identity = identity;
|
mus_params.identity = params.identity;
|
||||||
params.io_task_runner = io_task_runner;
|
mus_params.io_task_runner = params.io_task_runner;
|
||||||
params.wtc_config = mode == Mode::AURA_MUS2
|
mus_params.wtc_config = params.mode == Mode::AURA_MUS2
|
||||||
? aura::WindowTreeClient::Config::kMus2
|
? aura::WindowTreeClient::Config::kMus2
|
||||||
: aura::WindowTreeClient::Config::kMash;
|
: aura::WindowTreeClient::Config::kMash;
|
||||||
params.create_wm_state = true;
|
mus_params.create_wm_state = true;
|
||||||
mus_client_ = std::make_unique<MusClient>(params);
|
mus_client_ = std::make_unique<MusClient>(mus_params);
|
||||||
}
|
}
|
||||||
// MaterialDesignController may have initialized already (such as happens
|
// MaterialDesignController may have initialized already (such as happens
|
||||||
// in the utility process).
|
// in the utility process).
|
||||||
if (!ui::MaterialDesignController::is_mode_initialized())
|
if (!ui::MaterialDesignController::is_mode_initialized())
|
||||||
ui::MaterialDesignController::Initialize();
|
ui::MaterialDesignController::Initialize();
|
||||||
if (!InitializeResources(connector, resource_file, resource_file_200,
|
if (!InitializeResources(params))
|
||||||
register_path_provider)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
ui::InitializeInputMethodForTesting();
|
ui::InitializeInputMethodForTesting();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AuraInit::InitializeResources(service_manager::Connector* connector,
|
bool AuraInit::InitializeResources(const InitParams& params) {
|
||||||
const std::string& resource_file,
|
|
||||||
const std::string& resource_file_200,
|
|
||||||
bool register_path_provider) {
|
|
||||||
// Resources may have already been initialized (e.g. when chrome with mash is
|
// Resources may have already been initialized (e.g. when chrome with mash is
|
||||||
// used to launch the current app).
|
// used to launch the current app).
|
||||||
if (ui::ResourceBundle::HasSharedInstance())
|
if (ui::ResourceBundle::HasSharedInstance())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
std::set<std::string> resource_paths({resource_file});
|
std::set<std::string> resource_paths({params.resource_file});
|
||||||
if (!resource_file_200.empty())
|
if (!params.resource_file_200.empty())
|
||||||
resource_paths.insert(resource_file_200);
|
resource_paths.insert(params.resource_file_200);
|
||||||
|
|
||||||
catalog::ResourceLoader loader;
|
catalog::ResourceLoader loader;
|
||||||
filesystem::mojom::DirectoryPtr directory;
|
filesystem::mojom::DirectoryPtr directory;
|
||||||
connector->BindInterface(catalog::mojom::kServiceName, &directory);
|
params.connector->BindInterface(catalog::mojom::kServiceName, &directory);
|
||||||
// TODO(jonross): if this proves useful in resolving the crash of
|
// TODO(jonross): if this proves useful in resolving the crash of
|
||||||
// mash_unittests then switch AuraInit to have an Init method, returning a
|
// mash_unittests then switch AuraInit to have an Init method, returning a
|
||||||
// bool for success. Then update all callsites to use this to determine the
|
// bool for success. Then update all callsites to use this to determine the
|
||||||
@@ -127,17 +113,17 @@ bool AuraInit::InitializeResources(service_manager::Connector* connector,
|
|||||||
// Calling services will shutdown ServiceContext as appropriate.
|
// Calling services will shutdown ServiceContext as appropriate.
|
||||||
if (!loader.OpenFiles(std::move(directory), resource_paths))
|
if (!loader.OpenFiles(std::move(directory), resource_paths))
|
||||||
return false;
|
return false;
|
||||||
if (register_path_provider)
|
if (params.register_path_provider)
|
||||||
ui::RegisterPathProvider();
|
ui::RegisterPathProvider();
|
||||||
base::File pak_file = loader.TakeFile(resource_file);
|
base::File pak_file = loader.TakeFile(params.resource_file);
|
||||||
base::File pak_file_2 = pak_file.Duplicate();
|
base::File pak_file_2 = pak_file.Duplicate();
|
||||||
ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
|
ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
|
||||||
std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile);
|
std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile);
|
||||||
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
|
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
|
||||||
std::move(pak_file_2), ui::SCALE_FACTOR_100P);
|
std::move(pak_file_2), ui::SCALE_FACTOR_100P);
|
||||||
if (!resource_file_200.empty())
|
if (!params.resource_file_200.empty())
|
||||||
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
|
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
|
||||||
loader.TakeFile(resource_file_200), ui::SCALE_FACTOR_200P);
|
loader.TakeFile(params.resource_file_200), ui::SCALE_FACTOR_200P);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
|
#include "services/service_manager/public/cpp/identity.h"
|
||||||
#include "ui/aura/env.h"
|
#include "ui/aura/env.h"
|
||||||
#include "ui/views/mus/mus_export.h"
|
#include "ui/views/mus/mus_export.h"
|
||||||
|
|
||||||
@@ -22,7 +23,6 @@ class SingleThreadTaskRunner;
|
|||||||
|
|
||||||
namespace service_manager {
|
namespace service_manager {
|
||||||
class Connector;
|
class Connector;
|
||||||
class Identity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
@@ -49,20 +49,24 @@ class VIEWS_MUS_EXPORT AuraInit {
|
|||||||
|
|
||||||
~AuraInit();
|
~AuraInit();
|
||||||
|
|
||||||
|
struct VIEWS_MUS_EXPORT InitParams {
|
||||||
|
InitParams();
|
||||||
|
~InitParams();
|
||||||
|
service_manager::Connector* connector = nullptr;
|
||||||
|
service_manager::Identity identity;
|
||||||
|
// File for strings and 1x icons. Defaults to views_mus_resources.pak.
|
||||||
|
std::string resource_file;
|
||||||
|
// File for 2x icons. Can be empty.
|
||||||
|
std::string resource_file_200;
|
||||||
|
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr;
|
||||||
|
Mode mode = Mode::AURA_MUS;
|
||||||
|
bool register_path_provider = true;
|
||||||
|
};
|
||||||
|
|
||||||
// Returns an AuraInit if initialization can be completed successfully,
|
// Returns an AuraInit if initialization can be completed successfully,
|
||||||
// otherwise a nullptr is returned. If initialization fails then Aura is in an
|
// otherwise a nullptr is returned. If initialization fails then Aura is in an
|
||||||
// unusable state, and calling services should shutdown.
|
// unusable state, and calling services should shutdown.
|
||||||
// |resource_file| is the file to load strings and 1x icons from.
|
static std::unique_ptr<AuraInit> Create(const InitParams& params);
|
||||||
// |resource_file_200| can be an empty string, otherwise it is the file to
|
|
||||||
// load 2x icons from.
|
|
||||||
static std::unique_ptr<AuraInit> Create(
|
|
||||||
service_manager::Connector* connector,
|
|
||||||
const service_manager::Identity& identity,
|
|
||||||
const std::string& resource_file,
|
|
||||||
const std::string& resource_file_200 = std::string(),
|
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = nullptr,
|
|
||||||
Mode mode = Mode::AURA_MUS,
|
|
||||||
bool register_path_provider = true);
|
|
||||||
|
|
||||||
// Only valid if Mode::AURA_MUS was passed to constructor.
|
// Only valid if Mode::AURA_MUS was passed to constructor.
|
||||||
MusClient* mus_client() { return mus_client_.get(); }
|
MusClient* mus_client() { return mus_client_.get(); }
|
||||||
@@ -73,18 +77,10 @@ class VIEWS_MUS_EXPORT AuraInit {
|
|||||||
// Returns true if AuraInit was able to successfully complete initialization.
|
// Returns true if AuraInit was able to successfully complete initialization.
|
||||||
// If this returns false, then Aura is in an unusable state, and calling
|
// If this returns false, then Aura is in an unusable state, and calling
|
||||||
// services should shutdown.
|
// services should shutdown.
|
||||||
bool Init(service_manager::Connector* connector,
|
bool Init(const InitParams& params);
|
||||||
const service_manager::Identity& identity,
|
|
||||||
const std::string& resource_file,
|
|
||||||
const std::string& resource_file_200,
|
|
||||||
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
|
|
||||||
Mode mode,
|
|
||||||
bool register_path_provider);
|
|
||||||
|
|
||||||
bool InitializeResources(service_manager::Connector* connector,
|
// Returns true on success.
|
||||||
const std::string& resource_file,
|
bool InitializeResources(const InitParams& params);
|
||||||
const std::string& resource_file_200,
|
|
||||||
bool register_path_provider);
|
|
||||||
|
|
||||||
std::unique_ptr<aura::Env> env_;
|
std::unique_ptr<aura::Env> env_;
|
||||||
std::unique_ptr<MusClient> mus_client_;
|
std::unique_ptr<MusClient> mus_client_;
|
||||||
|
Reference in New Issue
Block a user