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

Side by Side Diff: chrome/browser/background_contents_service.cc

Issue 3163015: Remove deprecated wstring DictionaryValue::Get{Dictionary,List}WithoutPathExpansion() overloads. (Closed)
Patch Set: Created 10 years, 4 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 | « base/values_unittest.cc ('k') | chrome/browser/background_contents_service_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/background_contents_service.h" 5 #include "chrome/browser/background_contents_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return; 207 return;
208 208
209 // We store the first URL we receive for a given application. If there's 209 // We store the first URL we receive for a given application. If there's
210 // already an entry for this application, no need to do anything. 210 // already an entry for this application, no need to do anything.
211 // TODO(atwilson): Verify that this is the desired behavior based on developer 211 // TODO(atwilson): Verify that this is the desired behavior based on developer
212 // feedback (http://crbug.com/47118). 212 // feedback (http://crbug.com/47118).
213 DictionaryValue* pref = prefs_->GetMutableDictionary( 213 DictionaryValue* pref = prefs_->GetMutableDictionary(
214 prefs::kRegisteredBackgroundContents); 214 prefs::kRegisteredBackgroundContents);
215 const string16& appid = GetParentApplicationId(background_contents); 215 const string16& appid = GetParentApplicationId(background_contents);
216 DictionaryValue* current; 216 DictionaryValue* current;
217 if (pref->GetDictionaryWithoutPathExpansion(UTF16ToWide(appid), &current)) 217 if (pref->GetDictionaryWithoutPathExpansion(UTF16ToUTF8(appid), &current))
218 return; 218 return;
219 219
220 // No entry for this application yet, so add one. 220 // No entry for this application yet, so add one.
221 DictionaryValue* dict = new DictionaryValue(); 221 DictionaryValue* dict = new DictionaryValue();
222 dict->SetString(kUrlKey, background_contents->GetURL().spec()); 222 dict->SetString(kUrlKey, background_contents->GetURL().spec());
223 dict->SetString(kFrameNameKey, contents_map_[appid].frame_name); 223 dict->SetString(kFrameNameKey, contents_map_[appid].frame_name);
224 pref->SetWithoutPathExpansion(UTF16ToWide(appid), dict); 224 pref->SetWithoutPathExpansion(UTF16ToWide(appid), dict);
225 prefs_->ScheduleSavePersistentPrefs(); 225 prefs_->ScheduleSavePersistentPrefs();
226 } 226 }
227 227
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 if (contents == it->second.contents) 293 if (contents == it->second.contents)
294 return it->first; 294 return it->first;
295 } 295 }
296 return EmptyString16(); 296 return EmptyString16();
297 } 297 }
298 298
299 // static 299 // static
300 void BackgroundContentsService::RegisterUserPrefs(PrefService* prefs) { 300 void BackgroundContentsService::RegisterUserPrefs(PrefService* prefs) {
301 prefs->RegisterDictionaryPref(prefs::kRegisteredBackgroundContents); 301 prefs->RegisterDictionaryPref(prefs::kRegisteredBackgroundContents);
302 } 302 }
OLDNEW
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/background_contents_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698