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

Side by Side Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 2561983002: NavigationController: Reload methods migration (Closed)
Patch Set: merge master 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
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/browser/ui/browser_instant_controller.h" 5 #include "chrome/browser/ui/browser_instant_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/infobars/infobar_service.h" 8 #include "chrome/browser/infobars/infobar_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search/instant_service.h" 10 #include "chrome/browser/search/instant_service.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 explicit TabReloader(content::WebContents* web_contents) 49 explicit TabReloader(content::WebContents* web_contents)
50 : web_contents_(web_contents), weak_ptr_factory_(this) { 50 : web_contents_(web_contents), weak_ptr_factory_(this) {
51 content::BrowserThread::PostTask( 51 content::BrowserThread::PostTask(
52 content::BrowserThread::UI, 52 content::BrowserThread::UI,
53 FROM_HERE, 53 FROM_HERE,
54 base::Bind(&TabReloader::ReloadImpl, weak_ptr_factory_.GetWeakPtr())); 54 base::Bind(&TabReloader::ReloadImpl, weak_ptr_factory_.GetWeakPtr()));
55 } 55 }
56 ~TabReloader() override {} 56 ~TabReloader() override {}
57 57
58 void ReloadImpl() { 58 void ReloadImpl() {
59 web_contents_->GetController().Reload(false); 59 web_contents_->GetController().Reload(content::ReloadType::NORMAL, false);
60 60
61 // As the reload was not triggered by the user we don't want to close any 61 // As the reload was not triggered by the user we don't want to close any
62 // infobars. We have to tell the InfoBarService after the reload, 62 // infobars. We have to tell the InfoBarService after the reload,
63 // otherwise it would ignore this call when 63 // otherwise it would ignore this call when
64 // WebContentsObserver::DidStartNavigationToPendingEntry is invoked. 64 // WebContentsObserver::DidStartNavigationToPendingEntry is invoked.
65 InfoBarService::FromWebContents(web_contents_)->set_ignore_next_reload(); 65 InfoBarService::FromWebContents(web_contents_)->set_ignore_next_reload();
66 66
67 web_contents_->RemoveUserData(UserDataKey()); 67 web_contents_->RemoveUserData(UserDataKey());
68 } 68 }
69 69
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 params.referrer = content::Referrer(); 198 params.referrer = content::Referrer();
199 params.transition_type = ui::PAGE_TRANSITION_RELOAD; 199 params.transition_type = ui::PAGE_TRANSITION_RELOAD;
200 contents->GetController().LoadURLWithParams(params); 200 contents->GetController().LoadURLWithParams(params);
201 } else { 201 } else {
202 // Reload the contents to ensure that it gets assigned to a 202 // Reload the contents to ensure that it gets assigned to a
203 // non-privileged renderer. 203 // non-privileged renderer.
204 TabReloader::Reload(contents); 204 TabReloader::Reload(contents);
205 } 205 }
206 } 206 }
207 } 207 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698