OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/plugins/plugin_installer.h" | 5 #include "chrome/browser/plugins/plugin_installer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 item->SetOpenWhenComplete(true); | 166 item->SetOpenWhenComplete(true); |
167 item->AddObserver(this); | 167 item->AddObserver(this); |
168 } | 168 } |
169 | 169 |
170 void PluginInstaller::OpenDownloadURL(const GURL& plugin_url, | 170 void PluginInstaller::OpenDownloadURL(const GURL& plugin_url, |
171 content::WebContents* web_contents) { | 171 content::WebContents* web_contents) { |
172 DCHECK_EQ(INSTALLER_STATE_IDLE, state_); | 172 DCHECK_EQ(INSTALLER_STATE_IDLE, state_); |
173 web_contents->OpenURL(content::OpenURLParams( | 173 web_contents->OpenURL(content::OpenURLParams( |
174 plugin_url, | 174 plugin_url, |
175 content::Referrer(web_contents->GetURL(), | 175 content::Referrer(web_contents->GetURL(), |
176 WebKit::WebReferrerPolicyDefault), | 176 blink::WebReferrerPolicyDefault), |
177 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); | 177 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); |
178 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadFinished()); | 178 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadFinished()); |
179 } | 179 } |
180 | 180 |
181 void PluginInstaller::DownloadError(const std::string& msg) { | 181 void PluginInstaller::DownloadError(const std::string& msg) { |
182 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 182 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
183 state_ = INSTALLER_STATE_IDLE; | 183 state_ = INSTALLER_STATE_IDLE; |
184 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); | 184 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); |
185 } | 185 } |
186 | 186 |
187 void PluginInstaller::DownloadCancelled() { | 187 void PluginInstaller::DownloadCancelled() { |
188 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 188 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
189 state_ = INSTALLER_STATE_IDLE; | 189 state_ = INSTALLER_STATE_IDLE; |
190 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); | 190 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); |
191 } | 191 } |
OLD | NEW |