| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 item->AddObserver(this); | 125 item->AddObserver(this); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void PluginInstaller::OpenDownloadURL(const GURL& plugin_url, | 128 void PluginInstaller::OpenDownloadURL(const GURL& plugin_url, |
| 129 content::WebContents* web_contents) { | 129 content::WebContents* web_contents) { |
| 130 DCHECK_EQ(INSTALLER_STATE_IDLE, state_); | 130 DCHECK_EQ(INSTALLER_STATE_IDLE, state_); |
| 131 web_contents->OpenURL(content::OpenURLParams( | 131 web_contents->OpenURL(content::OpenURLParams( |
| 132 plugin_url, | 132 plugin_url, |
| 133 content::Referrer(web_contents->GetURL(), | 133 content::Referrer(web_contents->GetURL(), |
| 134 blink::WebReferrerPolicyDefault), | 134 blink::WebReferrerPolicyDefault), |
| 135 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); | 135 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_TYPED, false)); |
| 136 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadFinished()); | 136 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadFinished()); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void PluginInstaller::DownloadError(const std::string& msg) { | 139 void PluginInstaller::DownloadError(const std::string& msg) { |
| 140 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 140 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
| 141 state_ = INSTALLER_STATE_IDLE; | 141 state_ = INSTALLER_STATE_IDLE; |
| 142 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); | 142 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadError(msg)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void PluginInstaller::DownloadCancelled() { | 145 void PluginInstaller::DownloadCancelled() { |
| 146 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); | 146 DCHECK_EQ(INSTALLER_STATE_DOWNLOADING, state_); |
| 147 state_ = INSTALLER_STATE_IDLE; | 147 state_ = INSTALLER_STATE_IDLE; |
| 148 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); | 148 FOR_EACH_OBSERVER(PluginInstallerObserver, observers_, DownloadCancelled()); |
| 149 } | 149 } |
| OLD | NEW |