| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/devtools/protocol/page_handler.h" | 5 #include "content/browser/devtools/protocol/page_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 Response PageHandler::Reload(const bool* bypassCache, | 214 Response PageHandler::Reload(const bool* bypassCache, |
| 215 const std::string* script_to_evaluate_on_load, | 215 const std::string* script_to_evaluate_on_load, |
| 216 const std::string* script_preprocessor) { | 216 const std::string* script_preprocessor) { |
| 217 WebContentsImpl* web_contents = GetWebContents(); | 217 WebContentsImpl* web_contents = GetWebContents(); |
| 218 if (!web_contents) | 218 if (!web_contents) |
| 219 return Response::InternalError("Could not connect to view"); | 219 return Response::InternalError("Could not connect to view"); |
| 220 | 220 |
| 221 if (web_contents->IsCrashed() || | 221 if (web_contents->IsCrashed() || |
| 222 (web_contents->GetController().GetVisibleEntry() && | 222 (web_contents->GetController().GetVisibleEntry() && |
| 223 web_contents->GetController().GetVisibleEntry()->IsViewSourceMode())) { | 223 web_contents->GetController().GetVisibleEntry()->IsViewSourceMode())) { |
| 224 if (bypassCache && *bypassCache) | 224 web_contents->GetController().Reload(false, |
| 225 web_contents->GetController().ReloadBypassingCache(false); | 225 (bypassCache && *bypassCache) |
| 226 else | 226 ? ReloadType::BYPASSING_CACHE |
| 227 web_contents->GetController().Reload(false); | 227 : ReloadType::NORMAL); |
| 228 return Response::OK(); | 228 return Response::OK(); |
| 229 } else { | 229 } else { |
| 230 // Handle reload in renderer except for crashed and view source mode. | 230 // Handle reload in renderer except for crashed and view source mode. |
| 231 return Response::FallThrough(); | 231 return Response::FallThrough(); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 Response PageHandler::Navigate(const std::string& url, | 235 Response PageHandler::Navigate(const std::string& url, |
| 236 FrameId* frame_id) { | 236 FrameId* frame_id) { |
| 237 GURL gurl(url); | 237 GURL gurl(url); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 WebContentsImpl* web_contents = GetWebContents(); | 646 WebContentsImpl* web_contents = GetWebContents(); |
| 647 if (!web_contents) | 647 if (!web_contents) |
| 648 return Response::InternalError("Could not connect to view"); | 648 return Response::InternalError("Could not connect to view"); |
| 649 web_contents->Stop(); | 649 web_contents->Stop(); |
| 650 return Response::OK(); | 650 return Response::OK(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 } // namespace page | 653 } // namespace page |
| 654 } // namespace devtools | 654 } // namespace devtools |
| 655 } // namespace content | 655 } // namespace content |
| OLD | NEW |