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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 1167653007: Cleanup: Rename ChromeClient::setWindowRect and setWindowRectInternal. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 if (!frame() || !frame()->isMainFrame()) 1229 if (!frame() || !frame()->isMainFrame())
1230 return; 1230 return;
1231 1231
1232 FrameHost* host = frame()->host(); 1232 FrameHost* host = frame()->host();
1233 if (!host) 1233 if (!host)
1234 return; 1234 return;
1235 1235
1236 IntRect windowRect = host->chromeClient().windowRect(); 1236 IntRect windowRect = host->chromeClient().windowRect();
1237 windowRect.move(x, y); 1237 windowRect.move(x, y);
1238 // Security check (the spec talks about UniversalBrowserWrite to disable thi s check...) 1238 // Security check (the spec talks about UniversalBrowserWrite to disable thi s check...)
1239 host->chromeClient().setWindowRect(windowRect); 1239 host->chromeClient().setWindowRectWithAdjustment(windowRect);
1240 } 1240 }
1241 1241
1242 void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const 1242 void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
1243 { 1243 {
1244 if (!hasX || !hasY) 1244 if (!hasX || !hasY)
1245 UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArgumen ts); 1245 UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArgumen ts);
1246 1246
1247 if (!frame() || !frame()->isMainFrame()) 1247 if (!frame() || !frame()->isMainFrame())
1248 return; 1248 return;
1249 1249
1250 FrameHost* host = frame()->host(); 1250 FrameHost* host = frame()->host();
1251 if (!host) 1251 if (!host)
1252 return; 1252 return;
1253 1253
1254 IntRect windowRect = host->chromeClient().windowRect(); 1254 IntRect windowRect = host->chromeClient().windowRect();
1255 windowRect.setLocation(IntPoint(hasX ? x : windowRect.x(), hasY ? y : window Rect.y())); 1255 windowRect.setLocation(IntPoint(hasX ? x : windowRect.x(), hasY ? y : window Rect.y()));
1256 // Security check (the spec talks about UniversalBrowserWrite to disable thi s check...) 1256 // Security check (the spec talks about UniversalBrowserWrite to disable thi s check...)
1257 host->chromeClient().setWindowRect(windowRect); 1257 host->chromeClient().setWindowRectWithAdjustment(windowRect);
1258 } 1258 }
1259 1259
1260 void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const 1260 void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const
1261 { 1261 {
1262 if (!hasX || !hasY) 1262 if (!hasX || !hasY)
1263 UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArgumen ts); 1263 UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArgumen ts);
1264 1264
1265 if (!frame() || !frame()->isMainFrame()) 1265 if (!frame() || !frame()->isMainFrame())
1266 return; 1266 return;
1267 1267
1268 FrameHost* host = frame()->host(); 1268 FrameHost* host = frame()->host();
1269 if (!host) 1269 if (!host)
1270 return; 1270 return;
1271 1271
1272 IntRect fr = host->chromeClient().windowRect(); 1272 IntRect fr = host->chromeClient().windowRect();
1273 IntSize dest = fr.size() + IntSize(x, y); 1273 IntSize dest = fr.size() + IntSize(x, y);
1274 IntRect update(fr.location(), dest); 1274 IntRect update(fr.location(), dest);
1275 host->chromeClient().setWindowRect(update); 1275 host->chromeClient().setWindowRectWithAdjustment(update);
1276 } 1276 }
1277 1277
1278 void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeig ht) const 1278 void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeig ht) const
1279 { 1279 {
1280 if (!hasWidth || !hasHeight) 1280 if (!hasWidth || !hasHeight)
1281 UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArgumen ts); 1281 UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArgumen ts);
1282 1282
1283 if (!frame() || !frame()->isMainFrame()) 1283 if (!frame() || !frame()->isMainFrame())
1284 return; 1284 return;
1285 1285
1286 FrameHost* host = frame()->host(); 1286 FrameHost* host = frame()->host();
1287 if (!host) 1287 if (!host)
1288 return; 1288 return;
1289 1289
1290 IntRect fr = host->chromeClient().windowRect(); 1290 IntRect fr = host->chromeClient().windowRect();
1291 IntSize dest = IntSize(hasWidth ? width : fr.width(), hasHeight ? height : f r.height()); 1291 IntSize dest = IntSize(hasWidth ? width : fr.width(), hasHeight ? height : f r.height());
1292 IntRect update(fr.location(), dest); 1292 IntRect update(fr.location(), dest);
1293 host->chromeClient().setWindowRect(update); 1293 host->chromeClient().setWindowRectWithAdjustment(update);
1294 } 1294 }
1295 1295
1296 int LocalDOMWindow::requestAnimationFrame(FrameRequestCallback* callback) 1296 int LocalDOMWindow::requestAnimationFrame(FrameRequestCallback* callback)
1297 { 1297 {
1298 callback->m_useLegacyTimeBase = false; 1298 callback->m_useLegacyTimeBase = false;
1299 if (Document* d = document()) 1299 if (Document* d = document())
1300 return d->requestAnimationFrame(callback); 1300 return d->requestAnimationFrame(callback);
1301 return 0; 1301 return 0;
1302 } 1302 }
1303 1303
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 DOMWindow::trace(visitor); 1526 DOMWindow::trace(visitor);
1527 DOMWindowLifecycleNotifier::trace(visitor); 1527 DOMWindowLifecycleNotifier::trace(visitor);
1528 } 1528 }
1529 1529
1530 LocalFrame* LocalDOMWindow::frame() const 1530 LocalFrame* LocalDOMWindow::frame() const
1531 { 1531 {
1532 return m_frameObserver->frame(); 1532 return m_frameObserver->frame();
1533 } 1533 }
1534 1534
1535 } // namespace blink 1535 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698