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

Side by Side Diff: mash/quick_launch/quick_launch.cc

Issue 2967943002: Update AuraInit to handle failed initialization (Closed)
Patch Set: Created 3 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "mash/quick_launch/quick_launch.h" 5 #include "mash/quick_launch/quick_launch.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 void QuickLaunch::RemoveWindow(views::Widget* window) { 165 void QuickLaunch::RemoveWindow(views::Widget* window) {
166 auto it = std::find(windows_.begin(), windows_.end(), window); 166 auto it = std::find(windows_.begin(), windows_.end(), window);
167 DCHECK(it != windows_.end()); 167 DCHECK(it != windows_.end());
168 windows_.erase(it); 168 windows_.erase(it);
169 if (windows_.empty() && base::RunLoop::IsRunningOnCurrentThread()) 169 if (windows_.empty() && base::RunLoop::IsRunningOnCurrentThread())
170 base::MessageLoop::current()->QuitWhenIdle(); 170 base::MessageLoop::current()->QuitWhenIdle();
171 } 171 }
172 172
173 void QuickLaunch::OnStart() { 173 void QuickLaunch::OnStart() {
174 aura_init_ = base::MakeUnique<views::AuraInit>( 174 aura_init_ = base::MakeUnique<views::AuraInit>();
175 context()->connector(), context()->identity(), "views_mus_resources.pak",
176 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
177 175
178 // If AuraInit was unable to initialize there is no longer a peer connection. 176 // If AuraInit was unable to initialize there is no longer a peer connection.
179 // The ServiceManager is in the process of shutting down, however we haven't 177 // The ServiceManager is in the process of shutting down, however we haven't
180 // been notified yet. Close our ServiceContext and shutdown. 178 // been notified yet. Close our ServiceContext and shutdown.
181 if (!aura_init_->initialized()) { 179 if (!aura_init_->Init(context()->connector(), context()->identity(),
180 "views_mus_resources.pak", std::string(), nullptr,
181 views::AuraInit::Mode::AURA_MUS)) {
182 context()->QuitNow(); 182 context()->QuitNow();
183 return; 183 return;
184 } 184 }
185 185
186 Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW); 186 Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW);
187 } 187 }
188 188
189 void QuickLaunch::OnBindInterface( 189 void QuickLaunch::OnBindInterface(
190 const service_manager::BindSourceInfo& source_info, 190 const service_manager::BindSourceInfo& source_info,
191 const std::string& interface_name, 191 const std::string& interface_name,
(...skipping 20 matching lines...) Expand all
212 windows_.push_back(window); 212 windows_.push_back(window);
213 } 213 }
214 214
215 void QuickLaunch::Create(const service_manager::BindSourceInfo& source_info, 215 void QuickLaunch::Create(const service_manager::BindSourceInfo& source_info,
216 ::mash::mojom::LaunchableRequest request) { 216 ::mash::mojom::LaunchableRequest request) {
217 bindings_.AddBinding(this, std::move(request)); 217 bindings_.AddBinding(this, std::move(request));
218 } 218 }
219 219
220 } // namespace quick_launch 220 } // namespace quick_launch
221 } // namespace mash 221 } // namespace mash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698