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

Side by Side Diff: sky/engine/web/WebLocalFrameImpl.cpp

Issue 940703002: Make it possible to load a WebFrame from a URL (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Indent Created 5 years, 10 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
« no previous file with comments | « sky/engine/web/WebLocalFrameImpl.h ('k') | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 frame()->document()->addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, webCoreMessageLevel, message.text)); 252 frame()->document()->addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, webCoreMessageLevel, message.text));
253 } 253 }
254 254
255 void WebLocalFrameImpl::collectGarbage() 255 void WebLocalFrameImpl::collectGarbage()
256 { 256 {
257 // TODO(dart): Implement. 257 // TODO(dart): Implement.
258 } 258 }
259 259
260 void WebLocalFrameImpl::load(const WebURL& url, mojo::ScopedDataPipeConsumerHand le responseStream) 260 void WebLocalFrameImpl::load(const WebURL& url, mojo::ScopedDataPipeConsumerHand le responseStream)
261 { 261 {
262 frame()->mojoLoader().load(url, responseStream.Pass()); 262 frame()->mojoLoader().init(url);
263 frame()->mojoLoader().parse(responseStream.Pass());
264 }
265
266 void WebLocalFrameImpl::load(const WebURL& url)
267 {
268 frame()->mojoLoader().init(url);
269 m_fetcher = adoptPtr(new MojoFetcher(this, url));
270 }
271
272 void WebLocalFrameImpl::OnReceivedResponse(mojo::URLResponsePtr response)
273 {
274 m_fetcher.clear();
275 if (!response->body.is_valid())
276 LOG(FATAL) << "Response has no body.";
277 frame()->mojoLoader().parse(response->body.Pass());
263 } 278 }
264 279
265 void WebLocalFrameImpl::replaceSelection(const WebString& text) 280 void WebLocalFrameImpl::replaceSelection(const WebString& text)
266 { 281 {
267 bool selectReplacement = false; 282 bool selectReplacement = false;
268 bool smartReplace = true; 283 bool smartReplace = true;
269 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep lace); 284 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep lace);
270 } 285 }
271 286
272 void WebLocalFrameImpl::insertText(const WebString& text) 287 void WebLocalFrameImpl::insertText(const WebString& text)
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 589
575 void WebLocalFrameImpl::setInputEventsTransformForEmulation(const IntSize& offse t, float contentScaleFactor) 590 void WebLocalFrameImpl::setInputEventsTransformForEmulation(const IntSize& offse t, float contentScaleFactor)
576 { 591 {
577 m_inputEventsOffsetForEmulation = offset; 592 m_inputEventsOffsetForEmulation = offset;
578 m_inputEventsScaleFactorForEmulation = contentScaleFactor; 593 m_inputEventsScaleFactorForEmulation = contentScaleFactor;
579 if (frame()->view()) 594 if (frame()->view())
580 frame()->view()->setInputEventsTransformForEmulation(m_inputEventsOffset ForEmulation, m_inputEventsScaleFactorForEmulation); 595 frame()->view()->setInputEventsTransformForEmulation(m_inputEventsOffset ForEmulation, m_inputEventsScaleFactorForEmulation);
581 } 596 }
582 597
583 } // namespace blink 598 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/web/WebLocalFrameImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698