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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 654953002: Navigation transitions (web to native app): Get names and rects of transition elements (Step 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review fix Created 6 years, 1 month 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 | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
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 * 8 *
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 2239 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 return; 2250 return;
2251 } 2251 }
2252 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2252 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2253 } 2253 }
2254 2254
2255 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context) 2255 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context)
2256 { 2256 {
2257 return context->hitRegionsCount(); 2257 return context->hitRegionsCount();
2258 } 2258 }
2259 2259
2260 PassRefPtrWillBeRawPtr<ClientRect> Internals::boundsInRootViewSpace(Element* ele ment)
2261 {
2262 ASSERT(element);
2263 return ClientRect::create(element->boundsInRootViewSpace());
2264 }
2265
2260 String Internals::serializeNavigationMarkup() 2266 String Internals::serializeNavigationMarkup()
2261 { 2267 {
2262 Vector<Document::TransitionElementData> elementData; 2268 Vector<Document::TransitionElementData> elementData;
2263 frame()->document()->getTransitionElementData(elementData); 2269 frame()->document()->getTransitionElementData(elementData);
2264 2270
2265 StringBuilder markup; 2271 StringBuilder markup;
2266 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ; 2272 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ;
2267 for (; iter != elementData.end(); ++iter) 2273 for (; iter != elementData.end(); ++iter)
2268 markup.append(iter->markup); 2274 markup.append(iter->markup);
2269 2275
2270 return markup.toString(); 2276 return markup.toString();
2271 } 2277 }
2272 2278
2279 Vector<String> Internals::getTransitionElementIds()
2280 {
2281 Vector<Document::TransitionElementData> elementData;
2282 frame()->document()->getTransitionElementData(elementData);
2283
2284 Vector<String> ids;
2285 for (size_t i = 0; i < elementData.size(); ++i) {
2286 for (size_t j = 0; j < elementData[i].elements.size(); ++j)
2287 ids.append(elementData[i].elements[j].id);
2288 }
2289
2290 return ids;
2291 }
2292
2293 PassRefPtrWillBeRawPtr<ClientRectList> Internals::getTransitionElementRects()
2294 {
2295 Vector<Document::TransitionElementData> elementData;
2296 frame()->document()->getTransitionElementData(elementData);
2297
2298 Vector<IntRect> rects;
2299 for (size_t i = 0; i < elementData.size(); ++i) {
2300 for (size_t j = 0; j < elementData[i].elements.size(); ++j)
2301 rects.append(elementData[i].elements[j].rect);
2302 }
2303
2304 Vector<FloatQuad> quads(rects.size());
2305 for (size_t i = 0; i < rects.size(); ++i)
2306 quads[i] = FloatRect(rects[i]);
2307 return ClientRectList::create(quads);
2308 }
2309
2273 void Internals::hideAllTransitionElements() 2310 void Internals::hideAllTransitionElements()
2274 { 2311 {
2275 Vector<Document::TransitionElementData> elementData; 2312 Vector<Document::TransitionElementData> elementData;
2276 frame()->document()->getTransitionElementData(elementData); 2313 frame()->document()->getTransitionElementData(elementData);
2277 2314
2278 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ; 2315 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ;
2279 for (; iter != elementData.end(); ++iter) 2316 for (; iter != elementData.end(); ++iter)
2280 frame()->document()->hideTransitionElements(AtomicString(iter->selector) ); 2317 frame()->document()->hideTransitionElements(AtomicString(iter->selector) );
2281 } 2318 }
2282 2319
(...skipping 14 matching lines...) Expand all
2297 } 2334 }
2298 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options)); 2335 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options));
2299 } 2336 }
2300 2337
2301 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState) 2338 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState)
2302 { 2339 {
2303 return new InternalsIterator; 2340 return new InternalsIterator;
2304 } 2341 }
2305 2342
2306 } // namespace blink 2343 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698