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

Side by Side Diff: content/common/cursors/webcursor.cc

Issue 1507413003: clang/win: Let some chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_browsertests Created 5 years 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
« no previous file with comments | « content/child/npapi/webplugin_ime_win.cc ('k') | content/common/font_warmup_win_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/common/cursors/webcursor.h" 5 #include "content/common/cursors/webcursor.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "third_party/WebKit/public/platform/WebImage.h" 9 #include "third_party/WebKit/public/platform/WebImage.h"
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 { LoadCursor(NULL, IDC_WAIT), WebCursorInfo::TypeWait }, 185 { LoadCursor(NULL, IDC_WAIT), WebCursorInfo::TypeWait },
186 { LoadCursor(NULL, IDC_HELP), WebCursorInfo::TypeHelp }, 186 { LoadCursor(NULL, IDC_HELP), WebCursorInfo::TypeHelp },
187 { LoadCursor(NULL, IDC_SIZENESW), WebCursorInfo::TypeNorthEastResize }, 187 { LoadCursor(NULL, IDC_SIZENESW), WebCursorInfo::TypeNorthEastResize },
188 { LoadCursor(NULL, IDC_SIZENWSE), WebCursorInfo::TypeNorthWestResize }, 188 { LoadCursor(NULL, IDC_SIZENWSE), WebCursorInfo::TypeNorthWestResize },
189 { LoadCursor(NULL, IDC_SIZENS), WebCursorInfo::TypeNorthSouthResize }, 189 { LoadCursor(NULL, IDC_SIZENS), WebCursorInfo::TypeNorthSouthResize },
190 { LoadCursor(NULL, IDC_SIZEWE), WebCursorInfo::TypeEastWestResize }, 190 { LoadCursor(NULL, IDC_SIZEWE), WebCursorInfo::TypeEastWestResize },
191 { LoadCursor(NULL, IDC_SIZEALL), WebCursorInfo::TypeMove }, 191 { LoadCursor(NULL, IDC_SIZEALL), WebCursorInfo::TypeMove },
192 { LoadCursor(NULL, IDC_APPSTARTING), WebCursorInfo::TypeProgress }, 192 { LoadCursor(NULL, IDC_APPSTARTING), WebCursorInfo::TypeProgress },
193 { LoadCursor(NULL, IDC_NO), WebCursorInfo::TypeNotAllowed }, 193 { LoadCursor(NULL, IDC_NO), WebCursorInfo::TypeNotAllowed },
194 }; 194 };
195 for (int i = 0; i < arraysize(kStandardCursors); ++i) { 195 for (const auto& kStandardCursor : kStandardCursors) {
196 if (cursor == kStandardCursors[i].cursor) 196 if (cursor == kStandardCursor.cursor)
197 return kStandardCursors[i].type; 197 return kStandardCursor.type;
198 } 198 }
199 return WebCursorInfo::TypeCustom; 199 return WebCursorInfo::TypeCustom;
200 } 200 }
201 201
202 void WebCursor::InitFromExternalCursor(HCURSOR cursor) { 202 void WebCursor::InitFromExternalCursor(HCURSOR cursor) {
203 WebCursorInfo::Type cursor_type = ToCursorType(cursor); 203 WebCursorInfo::Type cursor_type = ToCursorType(cursor);
204 204
205 InitFromCursorInfo(CursorInfo(cursor_type)); 205 InitFromCursorInfo(CursorInfo(cursor_type));
206 206
207 if (cursor_type == WebCursorInfo::TypeCustom) 207 if (cursor_type == WebCursorInfo::TypeCustom)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 return; 262 return;
263 263
264 // Clamp the hotspot to the custom image's dimensions. 264 // Clamp the hotspot to the custom image's dimensions.
265 hotspot_.set_x(std::max(0, 265 hotspot_.set_x(std::max(0,
266 std::min(custom_size_.width() - 1, hotspot_.x()))); 266 std::min(custom_size_.width() - 1, hotspot_.x())));
267 hotspot_.set_y(std::max(0, 267 hotspot_.set_y(std::max(0,
268 std::min(custom_size_.height() - 1, hotspot_.y()))); 268 std::min(custom_size_.height() - 1, hotspot_.y())));
269 } 269 }
270 270
271 } // namespace content 271 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/webplugin_ime_win.cc ('k') | content/common/font_warmup_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698