OLD | NEW |
---|---|
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 Loading... | |
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); |
Takashi Toyoshima
2016/12/15 06:21:51
This is used only for NTP reload on changing searc
| |
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 Loading... | |
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 } |
OLD | NEW |