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

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

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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/ui/webui/version_handler.h" 5 #include "chrome/browser/ui/webui/version_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // Respond with the variations info immediately. 91 // Respond with the variations info immediately.
92 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnVariationInfo, 92 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnVariationInfo,
93 *version_ui::GetVariationsList()); 93 *version_ui::GetVariationsList());
94 } 94 }
95 95
96 void VersionHandler::OnGotFilePaths(base::string16* executable_path_data, 96 void VersionHandler::OnGotFilePaths(base::string16* executable_path_data,
97 base::string16* profile_path_data) { 97 base::string16* profile_path_data) {
98 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 98 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
99 99
100 base::StringValue exec_path(*executable_path_data); 100 base::Value exec_path(*executable_path_data);
101 base::StringValue profile_path(*profile_path_data); 101 base::Value profile_path(*profile_path_data);
102 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFilePaths, 102 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFilePaths,
103 exec_path, profile_path); 103 exec_path, profile_path);
104 } 104 }
105 105
106 #if BUILDFLAG(ENABLE_PLUGINS) 106 #if BUILDFLAG(ENABLE_PLUGINS)
107 void VersionHandler::OnGotPlugins( 107 void VersionHandler::OnGotPlugins(
108 const std::vector<content::WebPluginInfo>& plugins) { 108 const std::vector<content::WebPluginInfo>& plugins) {
109 // Obtain the version of the first enabled Flash plugin. 109 // Obtain the version of the first enabled Flash plugin.
110 std::vector<content::WebPluginInfo> info_array; 110 std::vector<content::WebPluginInfo> info_array;
111 content::PluginService::GetInstance()->GetPluginInfoArray( 111 content::PluginService::GetInstance()->GetPluginInfoArray(
112 GURL(), content::kFlashPluginSwfMimeType, false, &info_array, NULL); 112 GURL(), content::kFlashPluginSwfMimeType, false, &info_array, NULL);
113 std::string flash_version_and_path = 113 std::string flash_version_and_path =
114 l10n_util::GetStringUTF8(IDS_PLUGINS_DISABLED_PLUGIN); 114 l10n_util::GetStringUTF8(IDS_PLUGINS_DISABLED_PLUGIN);
115 PluginPrefs* plugin_prefs = 115 PluginPrefs* plugin_prefs =
116 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get(); 116 PluginPrefs::GetForProfile(Profile::FromWebUI(web_ui())).get();
117 if (plugin_prefs) { 117 if (plugin_prefs) {
118 for (size_t i = 0; i < info_array.size(); ++i) { 118 for (size_t i = 0; i < info_array.size(); ++i) {
119 if (plugin_prefs->IsPluginEnabled(info_array[i])) { 119 if (plugin_prefs->IsPluginEnabled(info_array[i])) {
120 flash_version_and_path = base::StringPrintf( 120 flash_version_and_path = base::StringPrintf(
121 "%s %s", base::UTF16ToUTF8(info_array[i].version).c_str(), 121 "%s %s", base::UTF16ToUTF8(info_array[i].version).c_str(),
122 base::UTF16ToUTF8(info_array[i].path.LossyDisplayName()).c_str()); 122 base::UTF16ToUTF8(info_array[i].path.LossyDisplayName()).c_str());
123 break; 123 break;
124 } 124 }
125 } 125 }
126 } 126 }
127 127
128 base::StringValue arg(flash_version_and_path); 128 base::Value arg(flash_version_and_path);
129 129
130 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFlashVersion, arg); 130 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFlashVersion, arg);
131 } 131 }
132 #endif // BUILDFLAG(ENABLE_PLUGINS) 132 #endif // BUILDFLAG(ENABLE_PLUGINS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc ('k') | chrome/browser/ui/webui/version_handler_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698