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/plugin_observer.h" | 5 #include "chrome/browser/plugin_observer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 class PluginObserver::PluginPlaceholderHost : public PluginInstallerObserver { | 116 class PluginObserver::PluginPlaceholderHost : public PluginInstallerObserver { |
117 public: | 117 public: |
118 PluginPlaceholderHost(PluginObserver* observer, | 118 PluginPlaceholderHost(PluginObserver* observer, |
119 int routing_id, | 119 int routing_id, |
120 PluginInstaller* installer) | 120 PluginInstaller* installer) |
121 : PluginInstallerObserver(installer), | 121 : PluginInstallerObserver(installer), |
122 observer_(observer), | 122 observer_(observer), |
123 routing_id_(routing_id) { | 123 routing_id_(routing_id) { |
124 DCHECK(installer); | 124 DCHECK(installer); |
125 switch (installer->state()) { | 125 switch (installer->state()) { |
126 case PluginInstaller::INSTALLER_STATE_IDLE: { | 126 case PluginInstaller::kStateIdle: { |
127 observer->Send(new ChromeViewMsg_FoundMissingPlugin(routing_id_, | 127 observer->Send(new ChromeViewMsg_FoundMissingPlugin(routing_id_, |
128 installer->name())); | 128 installer->name())); |
129 break; | 129 break; |
130 } | 130 } |
131 case PluginInstaller::INSTALLER_STATE_DOWNLOADING: { | 131 case PluginInstaller::kStateDownloading: { |
132 DownloadStarted(); | 132 DownloadStarted(); |
133 break; | 133 break; |
134 } | 134 } |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 // PluginInstallerObserver methods: | 138 // PluginInstallerObserver methods: |
139 virtual void DownloadStarted() OVERRIDE { | 139 virtual void DownloadStarted() OVERRIDE { |
140 observer_->Send(new ChromeViewMsg_StartedDownloadingPlugin(routing_id_)); | 140 observer_->Send(new ChromeViewMsg_StartedDownloadingPlugin(routing_id_)); |
141 } | 141 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 298 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
299 | 299 |
300 void PluginObserver::OnOpenAboutPlugins() { | 300 void PluginObserver::OnOpenAboutPlugins() { |
301 web_contents()->OpenURL(OpenURLParams( | 301 web_contents()->OpenURL(OpenURLParams( |
302 GURL(chrome::kAboutPluginsURL), | 302 GURL(chrome::kAboutPluginsURL), |
303 content::Referrer(web_contents()->GetURL(), | 303 content::Referrer(web_contents()->GetURL(), |
304 WebKit::WebReferrerPolicyDefault), | 304 WebKit::WebReferrerPolicyDefault), |
305 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); | 305 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); |
306 } | 306 } |
OLD | NEW |