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