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

Side by Side Diff: Source/core/layout/LayoutThemeChromiumSkia.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix a crashers (everything is building!) Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. 2 * Copyright (C) 2007 Apple Inc.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2008 Collabora Ltd. 4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008, 2009 Google Inc. 5 * Copyright (C) 2008, 2009 Google Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return 0; 125 return 0;
126 126
127 return caretBlinkIntervalInternal(); 127 return caretBlinkIntervalInternal();
128 } 128 }
129 129
130 void LayoutThemeChromiumSkia::systemFont(CSSValueID systemFontID, FontStyle& fon tStyle, FontWeight& fontWeight, float& fontSize, AtomicString& fontFamily) const 130 void LayoutThemeChromiumSkia::systemFont(CSSValueID systemFontID, FontStyle& fon tStyle, FontWeight& fontWeight, float& fontSize, AtomicString& fontFamily) const
131 { 131 {
132 LayoutThemeChromiumFontProvider::systemFont(systemFontID, fontStyle, fontWei ght, fontSize, fontFamily); 132 LayoutThemeChromiumFontProvider::systemFont(systemFontID, fontStyle, fontWei ght, fontSize, fontFamily);
133 } 133 }
134 134
135 int LayoutThemeChromiumSkia::minimumMenuListSize(RenderStyle* style) const 135 int LayoutThemeChromiumSkia::minimumMenuListSize(const RenderStyle* style) const
136 { 136 {
137 return 0; 137 return 0;
138 } 138 }
139 139
140 // These are the default dimensions of radio buttons and checkboxes. 140 // These are the default dimensions of radio buttons and checkboxes.
141 static const int widgetStandardWidth = 13; 141 static const int widgetStandardWidth = 13;
142 static const int widgetStandardHeight = 13; 142 static const int widgetStandardHeight = 13;
143 143
144 // Return a rectangle that has the same center point as |original|, but with a 144 // Return a rectangle that has the same center point as |original|, but with a
145 // size capped at |width| by |height|. 145 // size capped at |width| by |height|.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 { 366 {
367 adjustMenuListStyle(style, e); 367 adjustMenuListStyle(style, e);
368 } 368 }
369 369
370 // Used to paint styled menulists (i.e. with a non-default border) 370 // Used to paint styled menulists (i.e. with a non-default border)
371 bool LayoutThemeChromiumSkia::paintMenuListButton(RenderObject* o, const PaintIn fo& i, const IntRect& rect) 371 bool LayoutThemeChromiumSkia::paintMenuListButton(RenderObject* o, const PaintIn fo& i, const IntRect& rect)
372 { 372 {
373 return paintMenuList(o, i, rect); 373 return paintMenuList(o, i, rect);
374 } 374 }
375 375
376 int LayoutThemeChromiumSkia::popupInternalPaddingLeft(RenderStyle* style) const 376 int LayoutThemeChromiumSkia::popupInternalPaddingLeft(const RenderStyle* style) const
377 { 377 {
378 return menuListInternalPadding(style, LeftPadding); 378 return menuListInternalPadding(style, LeftPadding);
379 } 379 }
380 380
381 int LayoutThemeChromiumSkia::popupInternalPaddingRight(RenderStyle* style) const 381 int LayoutThemeChromiumSkia::popupInternalPaddingRight(const RenderStyle* style) const
382 { 382 {
383 return menuListInternalPadding(style, RightPadding); 383 return menuListInternalPadding(style, RightPadding);
384 } 384 }
385 385
386 int LayoutThemeChromiumSkia::popupInternalPaddingTop(RenderStyle* style) const 386 int LayoutThemeChromiumSkia::popupInternalPaddingTop(const RenderStyle* style) c onst
387 { 387 {
388 return menuListInternalPadding(style, TopPadding); 388 return menuListInternalPadding(style, TopPadding);
389 } 389 }
390 390
391 int LayoutThemeChromiumSkia::popupInternalPaddingBottom(RenderStyle* style) cons t 391 int LayoutThemeChromiumSkia::popupInternalPaddingBottom(const RenderStyle* style ) const
392 { 392 {
393 return menuListInternalPadding(style, BottomPadding); 393 return menuListInternalPadding(style, BottomPadding);
394 } 394 }
395 395
396 // static 396 // static
397 void LayoutThemeChromiumSkia::setDefaultFontSize(int fontSize) 397 void LayoutThemeChromiumSkia::setDefaultFontSize(int fontSize)
398 { 398 {
399 LayoutThemeChromiumFontProvider::setDefaultFontSize(fontSize); 399 LayoutThemeChromiumFontProvider::setDefaultFontSize(fontSize);
400 } 400 }
401 401
402 double LayoutThemeChromiumSkia::caretBlinkIntervalInternal() const 402 double LayoutThemeChromiumSkia::caretBlinkIntervalInternal() const
403 { 403 {
404 return LayoutTheme::caretBlinkInterval(); 404 return LayoutTheme::caretBlinkInterval();
405 } 405 }
406 406
407 int LayoutThemeChromiumSkia::menuListArrowPadding() const 407 int LayoutThemeChromiumSkia::menuListArrowPadding() const
408 { 408 {
409 return ScrollbarTheme::theme()->scrollbarThickness(); 409 return ScrollbarTheme::theme()->scrollbarThickness();
410 } 410 }
411 411
412 int LayoutThemeChromiumSkia::menuListInternalPadding(RenderStyle* style, int pad dingType) const 412 int LayoutThemeChromiumSkia::menuListInternalPadding(const RenderStyle* style, i nt paddingType) const
413 { 413 {
414 // This internal padding is in addition to the user-supplied padding. 414 // This internal padding is in addition to the user-supplied padding.
415 // Matches the FF behavior. 415 // Matches the FF behavior.
416 int padding = styledMenuListInternalPadding[paddingType]; 416 int padding = styledMenuListInternalPadding[paddingType];
417 417
418 // Reserve the space for right arrow here. The rest of the padding is 418 // Reserve the space for right arrow here. The rest of the padding is
419 // set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from 419 // set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from
420 // RenderMenuList to lay out the individual items in the popup. 420 // RenderMenuList to lay out the individual items in the popup.
421 // If the MenuList actually has appearance "NoAppearance", then that means 421 // If the MenuList actually has appearance "NoAppearance", then that means
422 // we don't draw a button, so don't reserve space for it. 422 // we don't draw a button, so don't reserve space for it.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 486 }
487 487
488 LayoutThemeChromiumSkia::DirectionFlippingScope::~DirectionFlippingScope() 488 LayoutThemeChromiumSkia::DirectionFlippingScope::~DirectionFlippingScope()
489 { 489 {
490 if (!m_needsFlipping) 490 if (!m_needsFlipping)
491 return; 491 return;
492 m_paintInfo.context->restore(); 492 m_paintInfo.context->restore();
493 } 493 }
494 494
495 } // namespace blink 495 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698