OLD | NEW |
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 // Font Settings Extension API implementation. | 5 // Font Settings Extension API implementation. |
6 | 6 |
7 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" | 7 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 bool SetFontPrefExtensionFunction::RunImpl() { | 376 bool SetFontPrefExtensionFunction::RunImpl() { |
377 if (GetProfile()->IsOffTheRecord()) { | 377 if (GetProfile()->IsOffTheRecord()) { |
378 error_ = kSetFromIncognitoError; | 378 error_ = kSetFromIncognitoError; |
379 return false; | 379 return false; |
380 } | 380 } |
381 | 381 |
382 base::DictionaryValue* details = NULL; | 382 base::DictionaryValue* details = NULL; |
383 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details)); | 383 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details)); |
384 | 384 |
385 Value* value; | 385 base::Value* value; |
386 EXTENSION_FUNCTION_VALIDATE(details->Get(GetKey(), &value)); | 386 EXTENSION_FUNCTION_VALIDATE(details->Get(GetKey(), &value)); |
387 | 387 |
388 PreferenceAPI::Get(GetProfile()) | 388 PreferenceAPI::Get(GetProfile()) |
389 ->SetExtensionControlledPref(extension_id(), | 389 ->SetExtensionControlledPref(extension_id(), |
390 GetPrefName(), | 390 GetPrefName(), |
391 kExtensionPrefsScopeRegular, | 391 kExtensionPrefsScopeRegular, |
392 value->DeepCopy()); | 392 value->DeepCopy()); |
393 return true; | 393 return true; |
394 } | 394 } |
395 | 395 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 447 |
448 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { | 448 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { |
449 return prefs::kWebKitMinimumFontSize; | 449 return prefs::kWebKitMinimumFontSize; |
450 } | 450 } |
451 | 451 |
452 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { | 452 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { |
453 return kPixelSizeKey; | 453 return kPixelSizeKey; |
454 } | 454 } |
455 | 455 |
456 } // namespace extensions | 456 } // namespace extensions |
OLD | NEW |