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

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

Issue 2779893005: Continue to clean c_str() calls. (Closed)
Patch Set: Revert changes in font_service_app.cc Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/chrome_pages.cc ('k') | chrome/common/pepper_flash.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/instant_ui.h" 5 #include "chrome/browser/ui/webui/instant_ui.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 void InstantUIMessageHandler::SetPreferenceValue(const base::ListValue* args) { 115 void InstantUIMessageHandler::SetPreferenceValue(const base::ListValue* args) {
116 std::string pref_name; 116 std::string pref_name;
117 if (!args->GetString(0, &pref_name)) return; 117 if (!args->GetString(0, &pref_name)) return;
118 118
119 if (pref_name == prefs::kInstantUIZeroSuggestUrlPrefix) { 119 if (pref_name == prefs::kInstantUIZeroSuggestUrlPrefix) {
120 std::string value; 120 std::string value;
121 if (!args->GetString(1, &value)) 121 if (!args->GetString(1, &value))
122 return; 122 return;
123 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 123 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
124 prefs->SetString(pref_name.c_str(), value); 124 prefs->SetString(pref_name, value);
125 } 125 }
126 } 126 }
127 127
128 void InstantUIMessageHandler::GetDebugInfo(const base::ListValue* args) { 128 void InstantUIMessageHandler::GetDebugInfo(const base::ListValue* args) {
129 #if !defined(OS_ANDROID) 129 #if !defined(OS_ANDROID)
130 typedef std::pair<int64_t, std::string> DebugEvent; 130 typedef std::pair<int64_t, std::string> DebugEvent;
131 131
132 if (!web_ui()->GetWebContents()) 132 if (!web_ui()->GetWebContents())
133 return; 133 return;
134 Browser* browser = chrome::FindBrowserWithWebContents( 134 Browser* browser = chrome::FindBrowserWithWebContents(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 Profile* profile = Profile::FromWebUI(web_ui); 180 Profile* profile = Profile::FromWebUI(web_ui);
181 content::WebUIDataSource::Add(profile, CreateInstantHTMLSource()); 181 content::WebUIDataSource::Add(profile, CreateInstantHTMLSource());
182 } 182 }
183 183
184 // static 184 // static
185 void InstantUI::RegisterProfilePrefs( 185 void InstantUI::RegisterProfilePrefs(
186 user_prefs::PrefRegistrySyncable* registry) { 186 user_prefs::PrefRegistrySyncable* registry) {
187 registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, 187 registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix,
188 std::string()); 188 std::string());
189 } 189 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/chrome_pages.cc ('k') | chrome/common/pepper_flash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698