| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 extensions::preference_helpers::DispatchEventToExtensions( | 198 extensions::preference_helpers::DispatchEventToExtensions( |
| 199 profile_, | 199 profile_, |
| 200 event_name, | 200 event_name, |
| 201 &args, | 201 &args, |
| 202 APIPermission::kFontSettings, | 202 APIPermission::kFontSettings, |
| 203 false, | 203 false, |
| 204 pref_name); | 204 pref_name); |
| 205 } | 205 } |
| 206 | 206 |
| 207 FontSettingsAPI::FontSettingsAPI(Profile* profile) | 207 FontSettingsAPI::FontSettingsAPI(content::BrowserContext* context) |
| 208 : font_settings_event_router_(new FontSettingsEventRouter(profile)) { | 208 : font_settings_event_router_( |
| 209 } | 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<ProfileKeyedAPIFactory<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 ProfileKeyedAPIFactory<FontSettingsAPI>* FontSettingsAPI::GetFactoryInstance() { |
| 219 return g_factory.Pointer(); | 219 return g_factory.Pointer(); |
| (...skipping 227 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 |