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