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

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: use struct for transition element 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
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 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 return; 2237 return;
2238 } 2238 }
2239 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2239 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2240 } 2240 }
2241 2241
2242 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context) 2242 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context)
2243 { 2243 {
2244 return context->hitRegionsCount(); 2244 return context->hitRegionsCount();
2245 } 2245 }
2246 2246
2247 PassRefPtrWillBeRawPtr<ClientRect> Internals::boundsInRootViewSpace(Element* ele ment)
2248 {
2249 ASSERT(element);
2250 return ClientRect::create(element->boundsInRootViewSpace());
2251 }
2252
2247 String Internals::serializeNavigationMarkup() 2253 String Internals::serializeNavigationMarkup()
2248 { 2254 {
2249 Vector<Document::TransitionElementData> elementData; 2255 Vector<Document::TransitionElementData> elementData;
2250 frame()->document()->getTransitionElementData(elementData); 2256 frame()->document()->getTransitionElementData(elementData);
2251 2257
2252 StringBuilder markup; 2258 StringBuilder markup;
2253 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ; 2259 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ;
2254 for (; iter != elementData.end(); ++iter) 2260 for (; iter != elementData.end(); ++iter)
2255 markup.append(iter->markup); 2261 markup.append(iter->markup);
2256 2262
2257 return markup.toString(); 2263 return markup.toString();
2258 } 2264 }
2259 2265
2266 Vector<String> Internals::getTransitionElementNames()
2267 {
2268 Vector<Document::TransitionElementData> elementData;
2269 frame()->document()->getTransitionElementData(elementData);
2270
2271 Vector<String> names;
2272 for (size_t i = 0; i < elementData.size(); ++i) {
2273 for (size_t j = 0; j < elementData[i].elements.size(); ++j)
2274 names.append(elementData[i].elements[j].name);
2275 }
2276
2277 return names;
2278 }
2279
2280 PassRefPtrWillBeRawPtr<ClientRectList> Internals::getTransitionElementRects()
2281 {
2282 Vector<Document::TransitionElementData> elementData;
2283 frame()->document()->getTransitionElementData(elementData);
2284
2285 Vector<IntRect> rects;
2286 for (size_t i = 0; i < elementData.size(); ++i) {
2287 for (size_t j = 0; j < elementData[i].elements.size(); ++j)
2288 rects.append(elementData[i].elements[j].rect);
2289 }
2290
2291 Vector<FloatQuad> quads(rects.size());
2292 for (size_t i = 0; i < rects.size(); ++i)
2293 quads[i] = FloatRect(rects[i]);
2294 return ClientRectList::create(quads);
2295 }
2296
2260 void Internals::hideAllTransitionElements() 2297 void Internals::hideAllTransitionElements()
2261 { 2298 {
2262 Vector<Document::TransitionElementData> elementData; 2299 Vector<Document::TransitionElementData> elementData;
2263 frame()->document()->getTransitionElementData(elementData); 2300 frame()->document()->getTransitionElementData(elementData);
2264 2301
2265 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ; 2302 Vector<Document::TransitionElementData>::iterator iter = elementData.begin() ;
2266 for (; iter != elementData.end(); ++iter) 2303 for (; iter != elementData.end(); ++iter)
2267 frame()->document()->hideTransitionElements(AtomicString(iter->selector) ); 2304 frame()->document()->hideTransitionElements(AtomicString(iter->selector) );
2268 } 2305 }
2269 2306
(...skipping 14 matching lines...) Expand all
2284 } 2321 }
2285 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options)); 2322 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options));
2286 } 2323 }
2287 2324
2288 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState) 2325 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState)
2289 { 2326 {
2290 return new InternalsIterator; 2327 return new InternalsIterator;
2291 } 2328 }
2292 2329
2293 } // namespace blink 2330 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698