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 <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 APIPermission::kFontSettings, false, pref_name); | 194 APIPermission::kFontSettings, false, pref_name); |
195 } | 195 } |
196 | 196 |
197 FontSettingsAPI::FontSettingsAPI(content::BrowserContext* context) | 197 FontSettingsAPI::FontSettingsAPI(content::BrowserContext* context) |
198 : font_settings_event_router_( | 198 : font_settings_event_router_( |
199 new FontSettingsEventRouter(Profile::FromBrowserContext(context))) {} | 199 new FontSettingsEventRouter(Profile::FromBrowserContext(context))) {} |
200 | 200 |
201 FontSettingsAPI::~FontSettingsAPI() { | 201 FontSettingsAPI::~FontSettingsAPI() { |
202 } | 202 } |
203 | 203 |
204 static base::LazyInstance<BrowserContextKeyedAPIFactory<FontSettingsAPI> > | 204 static base::LazyInstance<BrowserContextKeyedAPIFactory<FontSettingsAPI>>:: |
205 g_factory = LAZY_INSTANCE_INITIALIZER; | 205 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
206 | 206 |
207 // static | 207 // static |
208 BrowserContextKeyedAPIFactory<FontSettingsAPI>* | 208 BrowserContextKeyedAPIFactory<FontSettingsAPI>* |
209 FontSettingsAPI::GetFactoryInstance() { | 209 FontSettingsAPI::GetFactoryInstance() { |
210 return g_factory.Pointer(); | 210 return g_factory.Pointer(); |
211 } | 211 } |
212 | 212 |
213 ExtensionFunction::ResponseAction FontSettingsClearFontFunction::Run() { | 213 ExtensionFunction::ResponseAction FontSettingsClearFontFunction::Run() { |
214 Profile* profile = Profile::FromBrowserContext(browser_context()); | 214 Profile* profile = Profile::FromBrowserContext(browser_context()); |
215 if (profile->IsOffTheRecord()) | 215 if (profile->IsOffTheRecord()) |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { | 430 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { |
431 return prefs::kWebKitMinimumFontSize; | 431 return prefs::kWebKitMinimumFontSize; |
432 } | 432 } |
433 | 433 |
434 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { | 434 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { |
435 return kPixelSizeKey; | 435 return kPixelSizeKey; |
436 } | 436 } |
437 | 437 |
438 } // namespace extensions | 438 } // namespace extensions |
OLD | NEW |