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

Side by Side Diff: content/browser/devtools/protocol/page_handler.cc

Issue 2561983002: NavigationController: Reload methods migration (Closed)
Patch Set: one more mac build fix Created 4 years 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 // 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 Response PageHandler::Reload(Maybe<bool> bypassCache, 208 Response PageHandler::Reload(Maybe<bool> bypassCache,
209 Maybe<std::string> script_to_evaluate_on_load) { 209 Maybe<std::string> script_to_evaluate_on_load) {
210 WebContentsImpl* web_contents = GetWebContents(); 210 WebContentsImpl* web_contents = GetWebContents();
211 if (!web_contents) 211 if (!web_contents)
212 return Response::InternalError(); 212 return Response::InternalError();
213 213
214 if (web_contents->IsCrashed() || 214 if (web_contents->IsCrashed() ||
215 (web_contents->GetController().GetVisibleEntry() && 215 (web_contents->GetController().GetVisibleEntry() &&
216 web_contents->GetController().GetVisibleEntry()->IsViewSourceMode())) { 216 web_contents->GetController().GetVisibleEntry()->IsViewSourceMode())) {
217 if (bypassCache.fromMaybe(false)) 217 web_contents->GetController().Reload(bypassCache.fromMaybe(false)
218 web_contents->GetController().ReloadBypassingCache(false); 218 ? ReloadType::BYPASSING_CACHE
219 else 219 : ReloadType::NORMAL,
220 web_contents->GetController().Reload(false); 220 false);
Takashi Toyoshima 2016/12/15 06:21:52 devtools will be ok to use false
221 return Response::OK(); 221 return Response::OK();
222 } else { 222 } else {
223 // Handle reload in renderer except for crashed and view source mode. 223 // Handle reload in renderer except for crashed and view source mode.
224 return Response::FallThrough(); 224 return Response::FallThrough();
225 } 225 }
226 } 226 }
227 227
228 Response PageHandler::Navigate(const std::string& url, 228 Response PageHandler::Navigate(const std::string& url,
229 Page::FrameId* frame_id) { 229 Page::FrameId* frame_id) {
230 GURL gurl(url); 230 GURL gurl(url);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 Response PageHandler::StopLoading() { 574 Response PageHandler::StopLoading() {
575 WebContentsImpl* web_contents = GetWebContents(); 575 WebContentsImpl* web_contents = GetWebContents();
576 if (!web_contents) 576 if (!web_contents)
577 return Response::InternalError(); 577 return Response::InternalError();
578 web_contents->Stop(); 578 web_contents->Stop();
579 return Response::OK(); 579 return Response::OK();
580 } 580 }
581 581
582 } // namespace protocol 582 } // namespace protocol
583 } // namespace content 583 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698