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

Side by Side Diff: chrome/browser/chromeos/first_run/drive_first_run_controller.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/first_run/drive_first_run_controller.h" 5 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/system/tray/system_tray_delegate.h" 10 #include "ash/common/system/tray/system_tray_delegate.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 std::string()); 321 std::string());
322 322
323 // Return false as we already created the WebContents here. 323 // Return false as we already created the WebContents here.
324 return false; 324 return false;
325 } 325 }
326 326
327 void DriveWebContentsManager::Observe( 327 void DriveWebContentsManager::Observe(
328 int type, 328 int type,
329 const content::NotificationSource& source, 329 const content::NotificationSource& source,
330 const content::NotificationDetails& details) { 330 const content::NotificationDetails& details) {
331 if (type == chrome::NOTIFICATION_BACKGROUND_CONTENTS_OPENED) { 331 DCHECK_EQ(chrome::NOTIFICATION_BACKGROUND_CONTENTS_OPENED, type);
332 const std::string app_id = base::UTF16ToUTF8( 332 const std::string app_id = base::UTF16ToUTF8(
333 content::Details<BackgroundContentsOpenedDetails>(details) 333 content::Details<BackgroundContentsOpenedDetails>(details)
334 ->application_id); 334 ->application_id);
335 if (app_id == app_id_) 335 if (app_id == app_id_)
336 OnOfflineInit(true, DriveFirstRunController::OUTCOME_OFFLINE_ENABLED); 336 OnOfflineInit(true, DriveFirstRunController::OUTCOME_OFFLINE_ENABLED);
337 }
338 } 337 }
339 338
340 //////////////////////////////////////////////////////////////////////////////// 339 ////////////////////////////////////////////////////////////////////////////////
341 // DriveFirstRunController 340 // DriveFirstRunController
342 341
343 DriveFirstRunController::DriveFirstRunController(Profile* profile) 342 DriveFirstRunController::DriveFirstRunController(Profile* profile)
344 : profile_(profile), 343 : profile_(profile),
345 started_(false), 344 started_(false),
346 initial_delay_secs_(kInitialDelaySeconds), 345 initial_delay_secs_(kInitialDelaySeconds),
347 web_contents_timeout_secs_(kWebContentsTimeoutSeconds), 346 web_contents_timeout_secs_(kWebContentsTimeoutSeconds),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 base::UTF8ToUTF16(extension->name()), GURL(), 467 base::UTF8ToUTF16(extension->name()), GURL(),
469 message_center::NotifierId(message_center::NotifierId::APPLICATION, 468 message_center::NotifierId(message_center::NotifierId::APPLICATION,
470 kDriveHostedAppId), 469 kDriveHostedAppId),
471 data, new DriveOfflineNotificationDelegate(profile_))); 470 data, new DriveOfflineNotificationDelegate(profile_)));
472 notification->set_priority(message_center::LOW_PRIORITY); 471 notification->set_priority(message_center::LOW_PRIORITY);
473 message_center::MessageCenter::Get()->AddNotification( 472 message_center::MessageCenter::Get()->AddNotification(
474 std::move(notification)); 473 std::move(notification));
475 } 474 }
476 475
477 } // namespace chromeos 476 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/external_cache.cc ('k') | chrome/browser/chromeos/login/auth/auth_prewarmer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698