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

Side by Side Diff: third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. 2 * Copyright (C) 2009 Apple Inc.
3 * Copyright (C) 2009 Google Inc. 3 * Copyright (C) 2009 Google Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Overlay play button size. 53 // Overlay play button size.
54 static const int mediaOverlayPlayButtonWidth = 48; 54 static const int mediaOverlayPlayButtonWidth = 48;
55 static const int mediaOverlayPlayButtonHeight = 48; 55 static const int mediaOverlayPlayButtonHeight = 48;
56 56
57 // Alpha for disabled elements. 57 // Alpha for disabled elements.
58 static const float kDisabledAlpha = 0.4; 58 static const float kDisabledAlpha = 0.4;
59 59
60 static Image* platformResource(const char* name) { 60 static Image* platformResource(const char* name) {
61 if (!gMediaControlImageMap) 61 if (!gMediaControlImageMap)
62 gMediaControlImageMap = new MediaControlImageMap(); 62 gMediaControlImageMap = new MediaControlImageMap();
63 if (Image* image = gMediaControlImageMap->get(name)) 63 if (Image* image = gMediaControlImageMap->at(name))
64 return image; 64 return image;
65 if (Image* image = Image::loadPlatformResource(name).leakRef()) { 65 if (Image* image = Image::loadPlatformResource(name).leakRef()) {
66 gMediaControlImageMap->set(name, image); 66 gMediaControlImageMap->set(name, image);
67 return image; 67 return image;
68 } 68 }
69 ASSERT_NOT_REACHED(); 69 ASSERT_NOT_REACHED();
70 return 0; 70 return 0;
71 } 71 }
72 72
73 static bool hasSource(const HTMLMediaElement* mediaElement) { 73 static bool hasSource(const HTMLMediaElement* mediaElement) {
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 void MediaControlsPainter::adjustMediaSliderThumbSize(ComputedStyle& style) { 596 void MediaControlsPainter::adjustMediaSliderThumbSize(ComputedStyle& style) {
597 const float zoomLevel = style.effectiveZoom(); 597 const float zoomLevel = style.effectiveZoom();
598 598
599 style.setWidth( 599 style.setWidth(
600 Length(static_cast<int>(mediaSliderThumbTouchWidth * zoomLevel), Fixed)); 600 Length(static_cast<int>(mediaSliderThumbTouchWidth * zoomLevel), Fixed));
601 style.setHeight( 601 style.setHeight(
602 Length(static_cast<int>(mediaSliderThumbTouchHeight * zoomLevel), Fixed)); 602 Length(static_cast<int>(mediaSliderThumbTouchHeight * zoomLevel), Fixed));
603 } 603 }
604 604
605 } // namespace blink 605 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698