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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 12601006: Removing base::DictionaryValue::key_iterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch. Created 7 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 | 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
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/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 570
571 void ProfileImpl::InitHostZoomMap() { 571 void ProfileImpl::InitHostZoomMap() {
572 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); 572 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
573 host_zoom_map->SetDefaultZoomLevel( 573 host_zoom_map->SetDefaultZoomLevel(
574 prefs_->GetDouble(prefs::kDefaultZoomLevel)); 574 prefs_->GetDouble(prefs::kDefaultZoomLevel));
575 575
576 const DictionaryValue* host_zoom_dictionary = 576 const DictionaryValue* host_zoom_dictionary =
577 prefs_->GetDictionary(prefs::kPerHostZoomLevels); 577 prefs_->GetDictionary(prefs::kPerHostZoomLevels);
578 // Careful: The returned value could be NULL if the pref has never been set. 578 // Careful: The returned value could be NULL if the pref has never been set.
579 if (host_zoom_dictionary != NULL) { 579 if (host_zoom_dictionary != NULL) {
580 for (DictionaryValue::key_iterator i(host_zoom_dictionary->begin_keys()); 580 for (DictionaryValue::Iterator i(*host_zoom_dictionary); !i.IsAtEnd();
581 i != host_zoom_dictionary->end_keys(); ++i) { 581 i.Advance()) {
582 const std::string& host(*i); 582 const std::string& host(i.key());
583 double zoom_level = 0; 583 double zoom_level = 0;
584 584
585 bool success = host_zoom_dictionary->GetDoubleWithoutPathExpansion( 585 bool success = i.value().GetAsDouble(&zoom_level);
586 host, &zoom_level);
587 DCHECK(success); 586 DCHECK(success);
588 host_zoom_map->SetZoomLevel(host, zoom_level); 587 host_zoom_map->SetZoomLevel(host, zoom_level);
589 } 588 }
590 } 589 }
591 590
592 host_zoom_map->AddZoomLevelChangedCallback(zoom_callback_); 591 host_zoom_map->AddZoomLevelChangedCallback(zoom_callback_);
593 } 592 }
594 593
595 base::FilePath ProfileImpl::last_selected_directory() { 594 base::FilePath ProfileImpl::last_selected_directory() {
596 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); 595 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 base::FilePath* cache_path, 1161 base::FilePath* cache_path,
1163 int* max_size) { 1162 int* max_size) {
1164 DCHECK(cache_path); 1163 DCHECK(cache_path);
1165 DCHECK(max_size); 1164 DCHECK(max_size);
1166 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1165 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1167 if (!path.empty()) 1166 if (!path.empty())
1168 *cache_path = path; 1167 *cache_path = path;
1169 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1168 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1170 prefs_->GetInteger(prefs::kDiskCacheSize); 1169 prefs_->GetInteger(prefs::kDiskCacheSize);
1171 } 1170 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/component_cloud_policy_store.cc ('k') | chrome/browser/profiles/profile_info_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698