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

Side by Side Diff: chrome/browser/notifications/message_center_settings_controller.cc

Issue 1112403005: [chrome/browser] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nit Created 5 years, 7 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
« no previous file with comments | « chrome/browser/image_decoder.cc ('k') | chrome/browser/prefs/leveldb_pref_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/notifications/message_center_settings_controller.h" 5 #include "chrome/browser/notifications/message_center_settings_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/string_compare.h" 10 #include "base/i18n/string_compare.h"
11 #include "base/message_loop/message_loop_proxy.h"
12 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
13 #include "base/task/cancelable_task_tracker.h" 12 #include "base/task/cancelable_task_tracker.h"
13 #include "base/thread_task_runner_handle.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/extensions/app_icon_loader_impl.h" 16 #include "chrome/browser/extensions/app_icon_loader_impl.h"
17 #include "chrome/browser/favicon/favicon_service_factory.h" 17 #include "chrome/browser/favicon/favicon_service_factory.h"
18 #include "chrome/browser/notifications/desktop_notification_profile_util.h" 18 #include "chrome/browser/notifications/desktop_notification_profile_util.h"
19 #include "chrome/browser/notifications/desktop_notification_service.h" 19 #include "chrome/browser/notifications/desktop_notification_service.h"
20 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 20 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/profiles/profile_info_cache.h" 22 #include "chrome/browser/profiles/profile_info_cache.h"
23 #include "chrome/browser/profiles/profile_manager.h" 23 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // get the group here. 533 // get the group here.
534 if (notifier_groups_.empty() && user_manager::UserManager::IsInitialized() && 534 if (notifier_groups_.empty() && user_manager::UserManager::IsInitialized() &&
535 user_manager::UserManager::Get()->IsLoggedInAsGuest()) { 535 user_manager::UserManager::Get()->IsLoggedInAsGuest()) {
536 // Do not invoke CreateNotifierGroupForGuestLogin() directly. In some tests, 536 // Do not invoke CreateNotifierGroupForGuestLogin() directly. In some tests,
537 // this method may be called before the primary profile is created, which 537 // this method may be called before the primary profile is created, which
538 // means ProfileHelper::Get()->GetProfileByUser() will create a new primary 538 // means ProfileHelper::Get()->GetProfileByUser() will create a new primary
539 // profile. But creating a primary profile causes an Observe() before 539 // profile. But creating a primary profile causes an Observe() before
540 // registering it as the primary one, which causes this method which causes 540 // registering it as the primary one, which causes this method which causes
541 // another creating a primary profile, and causes an infinite loop. 541 // another creating a primary profile, and causes an infinite loop.
542 // Thus, it would be better to delay creating group for guest login. 542 // Thus, it would be better to delay creating group for guest login.
543 base::MessageLoopProxy::current()->PostTask( 543 base::ThreadTaskRunnerHandle::Get()->PostTask(
544 FROM_HERE, 544 FROM_HERE,
545 base::Bind( 545 base::Bind(
546 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, 546 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin,
547 weak_factory_.GetWeakPtr())); 547 weak_factory_.GetWeakPtr()));
548 } 548 }
549 #endif 549 #endif
550 550
551 if (notify) { 551 if (notify) {
552 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, 552 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver,
553 observers_, 553 observers_,
554 NotifierGroupChanged()); 554 NotifierGroupChanged());
555 } 555 }
556 } 556 }
OLDNEW
« no previous file with comments | « chrome/browser/image_decoder.cc ('k') | chrome/browser/prefs/leveldb_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698