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

Side by Side Diff: chrome/browser/chromeos/app_mode/startup_app_launcher.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/app_mode/startup_app_launcher.h" 5 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 304 }
305 registrar_.Remove(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, 305 registrar_.Remove(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND,
306 content::NotificationService::AllSources()); 306 content::NotificationService::AllSources());
307 307
308 MaybeLaunchApp(); 308 MaybeLaunchApp();
309 } 309 }
310 310
311 void StartupAppLauncher::Observe(int type, 311 void StartupAppLauncher::Observe(int type,
312 const content::NotificationSource& source, 312 const content::NotificationSource& source,
313 const content::NotificationDetails& details) { 313 const content::NotificationDetails& details) {
314 DCHECK(type == extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND); 314 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, type);
315 typedef const std::pair<std::string, Version> UpdateDetails; 315 using UpdateDetails = const std::pair<std::string, Version>;
316 const std::string& id = content::Details<UpdateDetails>(details)->first; 316 const std::string& id = content::Details<UpdateDetails>(details)->first;
317 const Version& version = content::Details<UpdateDetails>(details)->second; 317 const Version& version = content::Details<UpdateDetails>(details)->second;
318 VLOG(1) << "Found extension update id=" << id 318 VLOG(1) << "Found extension update id=" << id
319 << " version=" << version.GetString(); 319 << " version=" << version.GetString();
320 extension_update_found_ = true; 320 extension_update_found_ = true;
321 } 321 }
322 322
323 void StartupAppLauncher::OnFinishCrxInstall(const std::string& extension_id, 323 void StartupAppLauncher::OnFinishCrxInstall(const std::string& extension_id,
324 bool success) { 324 bool success) {
325 // Wait for pending updates or dependent extensions to download. 325 // Wait for pending updates or dependent extensions to download.
326 if (extensions::ExtensionSystem::Get(profile_) 326 if (extensions::ExtensionSystem::Get(profile_)
327 ->extension_service() 327 ->extension_service()
328 ->pending_extension_manager() 328 ->pending_extension_manager()
329 ->HasPendingExtensions()) { 329 ->HasPendingExtensions()) {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 // Skip copying meta data from the current installed primary app when 556 // Skip copying meta data from the current installed primary app when
557 // there is a pending update. 557 // there is a pending update.
558 if (PrimaryAppHasPendingUpdate()) 558 if (PrimaryAppHasPendingUpdate())
559 return; 559 return;
560 560
561 KioskAppManager::Get()->ClearAppData(app_id_); 561 KioskAppManager::Get()->ClearAppData(app_id_);
562 KioskAppManager::Get()->UpdateAppDataFromProfile(app_id_, profile_, NULL); 562 KioskAppManager::Get()->UpdateAppDataFromProfile(app_id_, profile_, NULL);
563 } 563 }
564 564
565 } // namespace chromeos 565 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_html_writer.cc ('k') | chrome/browser/chromeos/drive/drive_integration_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698