| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 pref_name); | 204 pref_name); |
| 205 } | 205 } |
| 206 | 206 |
| 207 FontSettingsAPI::FontSettingsAPI(content::BrowserContext* context) | 207 FontSettingsAPI::FontSettingsAPI(content::BrowserContext* context) |
| 208 : font_settings_event_router_( | 208 : font_settings_event_router_( |
| 209 new FontSettingsEventRouter(Profile::FromBrowserContext(context))) {} | 209 new FontSettingsEventRouter(Profile::FromBrowserContext(context))) {} |
| 210 | 210 |
| 211 FontSettingsAPI::~FontSettingsAPI() { | 211 FontSettingsAPI::~FontSettingsAPI() { |
| 212 } | 212 } |
| 213 | 213 |
| 214 static base::LazyInstance<ProfileKeyedAPIFactory<FontSettingsAPI> > | 214 static base::LazyInstance<BrowserContextKeyedAPIFactory<FontSettingsAPI> > |
| 215 g_factory = LAZY_INSTANCE_INITIALIZER; | 215 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 216 | 216 |
| 217 // static | 217 // static |
| 218 ProfileKeyedAPIFactory<FontSettingsAPI>* FontSettingsAPI::GetFactoryInstance() { | 218 BrowserContextKeyedAPIFactory<FontSettingsAPI>* |
| 219 FontSettingsAPI::GetFactoryInstance() { |
| 219 return g_factory.Pointer(); | 220 return g_factory.Pointer(); |
| 220 } | 221 } |
| 221 | 222 |
| 222 bool FontSettingsClearFontFunction::RunImpl() { | 223 bool FontSettingsClearFontFunction::RunImpl() { |
| 223 if (GetProfile()->IsOffTheRecord()) { | 224 if (GetProfile()->IsOffTheRecord()) { |
| 224 error_ = kSetFromIncognitoError; | 225 error_ = kSetFromIncognitoError; |
| 225 return false; | 226 return false; |
| 226 } | 227 } |
| 227 | 228 |
| 228 scoped_ptr<fonts::ClearFont::Params> params( | 229 scoped_ptr<fonts::ClearFont::Params> params( |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 448 |
| 448 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { | 449 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { |
| 449 return prefs::kWebKitMinimumFontSize; | 450 return prefs::kWebKitMinimumFontSize; |
| 450 } | 451 } |
| 451 | 452 |
| 452 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { | 453 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { |
| 453 return kPixelSizeKey; | 454 return kPixelSizeKey; |
| 454 } | 455 } |
| 455 | 456 |
| 456 } // namespace extensions | 457 } // namespace extensions |
| OLD | NEW |