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

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

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Eliminate old methods in interface Created 7 years, 10 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/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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // Careful: The returned value could be NULL if the pref has never been set. 587 // Careful: The returned value could be NULL if the pref has never been set.
588 if (host_zoom_dictionary != NULL) { 588 if (host_zoom_dictionary != NULL) {
589 for (DictionaryValue::key_iterator i(host_zoom_dictionary->begin_keys()); 589 for (DictionaryValue::key_iterator i(host_zoom_dictionary->begin_keys());
590 i != host_zoom_dictionary->end_keys(); ++i) { 590 i != host_zoom_dictionary->end_keys(); ++i) {
591 const std::string& host(*i); 591 const std::string& host(*i);
592 double zoom_level = 0; 592 double zoom_level = 0;
593 593
594 bool success = host_zoom_dictionary->GetDoubleWithoutPathExpansion( 594 bool success = host_zoom_dictionary->GetDoubleWithoutPathExpansion(
595 host, &zoom_level); 595 host, &zoom_level);
596 DCHECK(success); 596 DCHECK(success);
597 host_zoom_map->SetZoomLevel(host, zoom_level); 597 host_zoom_map->SetZoomLevel(std::string(), host, zoom_level);
598 } 598 }
599 } 599 }
600 600
601 #if defined(OS_CHROMEOS)
602 double no_zoom = 0;
603 host_zoom_map->SetZoomLevel(chrome::kChromeUIUberHost,
604 chrome::kChromeUIOobeHost,
605 no_zoom);
606 host_zoom_map->SetZoomLevel(chrome::kChromeUIUberHost,
607 chrome::kChromeUILoginHost,
608 no_zoom);
609 host_zoom_map->SetZoomLevel(chrome::kChromeUIUberHost,
610 chrome::kChromeUILockScreenHost,
611 no_zoom);
612 #endif
613
601 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, 614 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
602 content::Source<HostZoomMap>(host_zoom_map)); 615 content::Source<HostZoomMap>(host_zoom_map));
603 } 616 }
604 617
605 FilePath ProfileImpl::last_selected_directory() { 618 FilePath ProfileImpl::last_selected_directory() {
606 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); 619 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
607 } 620 }
608 621
609 void ProfileImpl::set_last_selected_directory(const FilePath& path) { 622 void ProfileImpl::set_last_selected_directory(const FilePath& path) {
610 GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path); 623 GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 966
954 void ProfileImpl::Observe(int type, 967 void ProfileImpl::Observe(int type,
955 const content::NotificationSource& source, 968 const content::NotificationSource& source,
956 const content::NotificationDetails& details) { 969 const content::NotificationDetails& details) {
957 switch (type) { 970 switch (type) {
958 case content::NOTIFICATION_ZOOM_LEVEL_CHANGED: { 971 case content::NOTIFICATION_ZOOM_LEVEL_CHANGED: {
959 const std::string& host = 972 const std::string& host =
960 *(content::Details<const std::string>(details).ptr()); 973 *(content::Details<const std::string>(details).ptr());
961 if (!host.empty()) { 974 if (!host.empty()) {
962 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); 975 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
963 double level = host_zoom_map->GetZoomLevel(host); 976 double level = host_zoom_map->GetZoomLevel(std::string(), host);
964 DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels); 977 DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels);
965 DictionaryValue* host_zoom_dictionary = update.Get(); 978 DictionaryValue* host_zoom_dictionary = update.Get();
966 if (level == host_zoom_map->GetDefaultZoomLevel()) { 979 if (level == host_zoom_map->GetDefaultZoomLevel()) {
967 host_zoom_dictionary->RemoveWithoutPathExpansion(host, NULL); 980 host_zoom_dictionary->RemoveWithoutPathExpansion(host, NULL);
968 } else { 981 } else {
969 host_zoom_dictionary->SetWithoutPathExpansion( 982 host_zoom_dictionary->SetWithoutPathExpansion(
970 host, Value::CreateDoubleValue(level)); 983 host, Value::CreateDoubleValue(level));
971 } 984 }
972 } 985 }
973 break; 986 break;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 FilePath* cache_path, 1185 FilePath* cache_path,
1173 int* max_size) { 1186 int* max_size) {
1174 DCHECK(cache_path); 1187 DCHECK(cache_path);
1175 DCHECK(max_size); 1188 DCHECK(max_size);
1176 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1189 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1177 if (!path.empty()) 1190 if (!path.empty())
1178 *cache_path = path; 1191 *cache_path = path;
1179 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1192 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1180 prefs_->GetInteger(prefs::kDiskCacheSize); 1193 prefs_->GetInteger(prefs::kDiskCacheSize);
1181 } 1194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698