OLD | NEW |
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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 base::Bind(&GetPluginsInfoCallback, &plugins, runner->QuitClosure())); | 120 base::Bind(&GetPluginsInfoCallback, &plugins, runner->QuitClosure())); |
121 runner->Run(); | 121 runner->Run(); |
122 return plugins; | 122 return plugins; |
123 } | 123 } |
124 | 124 |
125 static void EnableFlash(bool enable, Profile* profile) { | 125 static void EnableFlash(bool enable, Profile* profile) { |
126 std::vector<FilePath> paths; | 126 std::vector<FilePath> paths; |
127 GetFlashPath(&paths); | 127 GetFlashPath(&paths); |
128 ASSERT_FALSE(paths.empty()); | 128 ASSERT_FALSE(paths.empty()); |
129 | 129 |
130 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile); | 130 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile).get(); |
131 scoped_refptr<content::MessageLoopRunner> runner = | 131 scoped_refptr<content::MessageLoopRunner> runner = |
132 new content::MessageLoopRunner; | 132 new content::MessageLoopRunner; |
133 scoped_refptr<CallbackBarrier> callback_barrier( | 133 scoped_refptr<CallbackBarrier> callback_barrier( |
134 new CallbackBarrier(runner->QuitClosure())); | 134 new CallbackBarrier(runner->QuitClosure())); |
135 for (std::vector<FilePath>::iterator iter = paths.begin(); | 135 for (std::vector<FilePath>::iterator iter = paths.begin(); |
136 iter != paths.end(); ++iter) { | 136 iter != paths.end(); ++iter) { |
137 plugin_prefs->EnablePlugin(enable, *iter, | 137 plugin_prefs->EnablePlugin(enable, *iter, |
138 callback_barrier->CreateCallback()); | 138 callback_barrier->CreateCallback()); |
139 } | 139 } |
140 runner->Run(); | 140 runner->Run(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 std::vector<webkit::WebPluginInfo> plugins = GetPlugins(); | 253 std::vector<webkit::WebPluginInfo> plugins = GetPlugins(); |
254 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected); ++i) { | 254 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected); ++i) { |
255 size_t j = 0; | 255 size_t j = 0; |
256 for (; j < plugins.size(); ++j) { | 256 for (; j < plugins.size(); ++j) { |
257 if (plugins[j].name == ASCIIToUTF16(expected[i])) | 257 if (plugins[j].name == ASCIIToUTF16(expected[i])) |
258 break; | 258 break; |
259 } | 259 } |
260 ASSERT_TRUE(j != plugins.size()) << "Didn't find " << expected[i]; | 260 ASSERT_TRUE(j != plugins.size()) << "Didn't find " << expected[i]; |
261 } | 261 } |
262 } | 262 } |
OLD | NEW |