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

Side by Side Diff: chrome/browser/ui/webui/settings/font_handler.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/webui/settings/font_handler.h" 5 #include "chrome/browser/ui/webui/settings/font_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 extensions::ExtensionSystem::Get(profile_)->extension_service(); 98 extensions::ExtensionSystem::Get(profile_)->extension_service();
99 if (!service->IsExtensionEnabled(kAdvancedFontSettingsExtensionId)) 99 if (!service->IsExtensionEnabled(kAdvancedFontSettingsExtensionId))
100 return nullptr; 100 return nullptr;
101 return service->GetInstalledExtension(kAdvancedFontSettingsExtensionId); 101 return service->GetInstalledExtension(kAdvancedFontSettingsExtensionId);
102 } 102 }
103 103
104 void FontHandler::NotifyAdvancedFontSettingsAvailability() { 104 void FontHandler::NotifyAdvancedFontSettingsAvailability() {
105 CallJavascriptFunction( 105 CallJavascriptFunction(
106 "cr.webUIListenerCallback", 106 "cr.webUIListenerCallback",
107 base::StringValue("advanced-font-settings-installed"), 107 base::StringValue("advanced-font-settings-installed"),
108 base::FundamentalValue(GetAdvancedFontSettingsExtension() != nullptr)); 108 base::Value(GetAdvancedFontSettingsExtension() != nullptr));
109 } 109 }
110 110
111 void FontHandler::OnExtensionLoaded(content::BrowserContext*, 111 void FontHandler::OnExtensionLoaded(content::BrowserContext*,
112 const extensions::Extension*) { 112 const extensions::Extension*) {
113 NotifyAdvancedFontSettingsAvailability(); 113 NotifyAdvancedFontSettingsAvailability();
114 } 114 }
115 115
116 void FontHandler::OnExtensionUnloaded( 116 void FontHandler::OnExtensionUnloaded(
117 content::BrowserContext*, 117 content::BrowserContext*,
118 const extensions::Extension*, 118 const extensions::Extension*,
(...skipping 22 matching lines...) Expand all
141 141
142 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix()); 142 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix());
143 response.SetString( 143 response.SetString(
144 "extensionUrl", 144 "extensionUrl",
145 extension_url.Resolve(kAdvancedFontSettingsExtensionId).spec()); 145 extension_url.Resolve(kAdvancedFontSettingsExtensionId).spec());
146 146
147 ResolveJavascriptCallback(base::StringValue(callback_id), response); 147 ResolveJavascriptCallback(base::StringValue(callback_id), response);
148 } 148 }
149 149
150 } // namespace settings 150 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698