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

Side by Side Diff: chrome/browser/ui/webui/version_handler.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
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/ui/webui/version_handler.h" 5 #include "chrome/browser/ui/webui/version_handler.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 #if defined(ENABLE_PLUGINS) 130 #if defined(ENABLE_PLUGINS)
131 void VersionHandler::OnGotPlugins( 131 void VersionHandler::OnGotPlugins(
132 const std::vector<webkit::WebPluginInfo>& plugins) { 132 const std::vector<webkit::WebPluginInfo>& plugins) {
133 // Obtain the version of the first enabled Flash plugin. 133 // Obtain the version of the first enabled Flash plugin.
134 std::vector<webkit::WebPluginInfo> info_array; 134 std::vector<webkit::WebPluginInfo> info_array;
135 content::PluginService::GetInstance()->GetPluginInfoArray( 135 content::PluginService::GetInstance()->GetPluginInfoArray(
136 GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL); 136 GURL(), kFlashPluginSwfMimeType, false, &info_array, NULL);
137 string16 flash_version = 137 string16 flash_version =
138 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN); 138 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN);
139 PluginPrefs* plugin_prefs = 139 PluginPrefs* plugin_prefs =
140 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())); 140 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get();
141 if (plugin_prefs) { 141 if (plugin_prefs) {
142 for (size_t i = 0; i < info_array.size(); ++i) { 142 for (size_t i = 0; i < info_array.size(); ++i) {
143 if (plugin_prefs->IsPluginEnabled(info_array[i])) { 143 if (plugin_prefs->IsPluginEnabled(info_array[i])) {
144 flash_version = info_array[i].version; 144 flash_version = info_array[i].version;
145 break; 145 break;
146 } 146 }
147 } 147 }
148 } 148 }
149 149
150 StringValue arg(flash_version); 150 StringValue arg(flash_version);
151 web_ui()->CallJavascriptFunction("returnFlashVersion", arg); 151 web_ui()->CallJavascriptFunction("returnFlashVersion", arg);
152 } 152 }
153 #endif // defined(ENABLE_PLUGINS) 153 #endif // defined(ENABLE_PLUGINS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui.cc ('k') | chrome/browser/web_resource/json_asynchronous_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698