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

Side by Side Diff: chrome/browser/plugins/plugin_prefs.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/plugins/plugin_prefs.h" 5 #include "chrome/browser/plugins/plugin_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/prefs/scoped_user_pref_update.h" 14 #include "base/prefs/scoped_user_pref_update.h"
15 #include "base/single_thread_task_runner.h"
15 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
16 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "base/thread_task_runner_handle.h"
17 #include "base/values.h" 19 #include "base/values.h"
18 #include "build/build_config.h" 20 #include "build/build_config.h"
19 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/chrome_notification_types.h" 22 #include "chrome/browser/chrome_notification_types.h"
21 #include "chrome/browser/plugins/plugin_installer.h" 23 #include "chrome/browser/plugins/plugin_installer.h"
22 #include "chrome/browser/plugins/plugin_metadata.h" 24 #include "chrome/browser/plugins/plugin_metadata.h"
23 #include "chrome/browser/plugins/plugin_prefs_factory.h" 25 #include "chrome/browser/plugins/plugin_prefs_factory.h"
24 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/common/chrome_constants.h" 27 #include "chrome/common/chrome_constants.h"
26 #include "chrome/common/chrome_paths.h" 28 #include "chrome/common/chrome_paths.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 can_enable = false; 153 can_enable = false;
152 } else { 154 } else {
153 if (plugin_status == POLICY_ENABLED || group_status == POLICY_ENABLED) 155 if (plugin_status == POLICY_ENABLED || group_status == POLICY_ENABLED)
154 can_enable = false; 156 can_enable = false;
155 } 157 }
156 } else { 158 } else {
157 NOTREACHED(); 159 NOTREACHED();
158 } 160 }
159 161
160 if (!can_enable) { 162 if (!can_enable) {
161 base::MessageLoop::current()->PostTask(FROM_HERE, 163 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
162 base::Bind(callback, false)); 164 base::Bind(callback, false));
163 return; 165 return;
164 } 166 }
165 167
166 PluginService::GetInstance()->GetPlugins( 168 PluginService::GetInstance()->GetPlugins(
167 base::Bind(&PluginPrefs::EnablePluginInternal, this, 169 base::Bind(&PluginPrefs::EnablePluginInternal, this,
168 enabled, path, finder, callback)); 170 enabled, path, finder, callback));
169 } 171 }
170 172
171 void PluginPrefs::EnablePluginInternal( 173 void PluginPrefs::EnablePluginInternal(
172 bool enabled, 174 bool enabled,
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 } 580 }
579 } 581 }
580 582
581 void PluginPrefs::NotifyPluginStatusChanged() { 583 void PluginPrefs::NotifyPluginStatusChanged() {
582 DCHECK_CURRENTLY_ON(BrowserThread::UI); 584 DCHECK_CURRENTLY_ON(BrowserThread::UI);
583 content::NotificationService::current()->Notify( 585 content::NotificationService::current()->Notify(
584 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, 586 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED,
585 content::Source<Profile>(profile_), 587 content::Source<Profile>(profile_),
586 content::NotificationService::NoDetails()); 588 content::NotificationService::NoDetails());
587 } 589 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698