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

Side by Side Diff: chrome/browser/ui/webui/options/font_settings_handler.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months 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 (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 #include "chrome/browser/ui/webui/options/font_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/font_settings_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 NotifyAdvancedFontSettingsAvailability(); 191 NotifyAdvancedFontSettingsAvailability();
192 } 192 }
193 193
194 void FontSettingsHandler::HandleFetchFontsData(const base::ListValue* args) { 194 void FontSettingsHandler::HandleFetchFontsData(const base::ListValue* args) {
195 content::GetFontListAsync( 195 content::GetFontListAsync(
196 base::Bind(&FontSettingsHandler::FontsListHasLoaded, 196 base::Bind(&FontSettingsHandler::FontsListHasLoaded,
197 weak_ptr_factory_.GetWeakPtr())); 197 weak_ptr_factory_.GetWeakPtr()));
198 } 198 }
199 199
200 void FontSettingsHandler::FontsListHasLoaded( 200 void FontSettingsHandler::FontsListHasLoaded(
201 scoped_ptr<base::ListValue> list) { 201 std::unique_ptr<base::ListValue> list) {
202 // Selects the directionality for the fonts in the given list. 202 // Selects the directionality for the fonts in the given list.
203 for (size_t i = 0; i < list->GetSize(); i++) { 203 for (size_t i = 0; i < list->GetSize(); i++) {
204 base::ListValue* font; 204 base::ListValue* font;
205 bool has_font = list->GetList(i, &font); 205 bool has_font = list->GetList(i, &font);
206 DCHECK(has_font); 206 DCHECK(has_font);
207 base::string16 value; 207 base::string16 value;
208 bool has_value = font->GetString(1, &value); 208 bool has_value = font->GetString(1, &value);
209 DCHECK(has_value); 209 DCHECK(has_value);
210 bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(value); 210 bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(value);
211 font->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr")); 211 font->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr"));
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); 316 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()));
317 } 317 }
318 318
319 void FontSettingsHandler::OnWebKitDefaultFontSizeChanged() { 319 void FontSettingsHandler::OnWebKitDefaultFontSizeChanged() {
320 SetUpStandardFontSample(); 320 SetUpStandardFontSample();
321 SetUpSerifFontSample(); 321 SetUpSerifFontSample();
322 SetUpSansSerifFontSample(); 322 SetUpSansSerifFontSample();
323 } 323 }
324 324
325 } // namespace options 325 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_handler.h ('k') | chrome/browser/ui/webui/options/handler_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698