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

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

Issue 1080993005: Fix display of 404s in SkyShell to show error text. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 frame()->mojoLoader().parse(response->body.Pass()); 278 frame()->mojoLoader().parse(response->body.Pass());
279 return; 279 return;
280 } 280 }
281 LOG(ERROR) << "Response for " << response->url 281 LOG(ERROR) << "Response for " << response->url
282 << " (status " << response->status_code << ") has no body."; 282 << " (status " << response->status_code << ") has no body.";
283 283
284 // TODO(eseidel): This is a hack, but makes debugging way easier. 284 // TODO(eseidel): This is a hack, but makes debugging way easier.
285 mojo::DataPipe pipe; 285 mojo::DataPipe pipe;
286 frame()->mojoLoader().parse(pipe.consumer_handle.Pass()); 286 frame()->mojoLoader().parse(pipe.consumer_handle.Pass());
287 std::string error_response = base::StringPrintf( 287 std::string error_response = base::StringPrintf(
288 "<error><h>Empty Body</h><l>%d %s</l><m>%s</m></t></error>", 288 "<error><h style='display: paragraph'>Empty Body</h>"
289 "<l style='display: paragraph'>%d %s</l>"
290 "<m style='display: paragraph'>%s</m></t></error>",
289 response->status_code, response->status_line.get().c_str(), 291 response->status_code, response->status_line.get().c_str(),
290 response->error->description.get().c_str()); 292 response->error->description.get().c_str());
291 293
292 uint32_t length = error_response.length(); 294 uint32_t length = error_response.length();
293 MojoWriteData(pipe.producer_handle.get().value(), 295 MojoWriteData(pipe.producer_handle.get().value(),
294 error_response.data(), 296 error_response.data(),
295 &length, 297 &length,
296 MOJO_WRITE_DATA_FLAG_ALL_OR_NONE); 298 MOJO_WRITE_DATA_FLAG_ALL_OR_NONE);
297 } 299 }
298 300
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 610
609 void WebLocalFrameImpl::setInputEventsTransformForEmulation(const IntSize& offse t, float contentScaleFactor) 611 void WebLocalFrameImpl::setInputEventsTransformForEmulation(const IntSize& offse t, float contentScaleFactor)
610 { 612 {
611 m_inputEventsOffsetForEmulation = offset; 613 m_inputEventsOffsetForEmulation = offset;
612 m_inputEventsScaleFactorForEmulation = contentScaleFactor; 614 m_inputEventsScaleFactorForEmulation = contentScaleFactor;
613 if (frame()->view()) 615 if (frame()->view())
614 frame()->view()->setInputEventsTransformForEmulation(m_inputEventsOffset ForEmulation, m_inputEventsScaleFactorForEmulation); 616 frame()->view()->setInputEventsTransformForEmulation(m_inputEventsOffset ForEmulation, m_inputEventsScaleFactorForEmulation);
615 } 617 }
616 618
617 } // namespace blink 619 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698