| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PLUGIN_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PLUGIN_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_PLUGIN_OBSERVER_H_ | 6 #define CHROME_BROWSER_PLUGIN_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_vector.h" |
| 9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 10 #include "content/browser/tab_contents/tab_contents_observer.h" | 11 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 11 | 12 |
| 12 class GURL; | 13 class GURL; |
| 13 class InfoBarDelegate; | 14 class InfoBarDelegate; |
| 14 class PluginInstaller; | 15 class PluginInstaller; |
| 15 class TabContentsWrapper; | 16 class TabContentsWrapper; |
| 16 | 17 |
| 17 class PluginObserver : public TabContentsObserver { | 18 class PluginObserver : public TabContentsObserver { |
| 18 public: | 19 public: |
| 19 explicit PluginObserver(TabContentsWrapper* tab_contents); | 20 explicit PluginObserver(TabContentsWrapper* tab_contents); |
| 20 virtual ~PluginObserver(); | 21 virtual ~PluginObserver(); |
| 21 | 22 |
| 22 // IPC::Channel::Listener implementation. | 23 // IPC::Channel::Listener implementation. |
| 23 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 24 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 24 | 25 |
| 25 private: | 26 private: |
| 27 class MissingPluginHost; |
| 28 |
| 26 void OnBlockedOutdatedPlugin(const string16& name, const GURL& update_url); | 29 void OnBlockedOutdatedPlugin(const string16& name, const GURL& update_url); |
| 27 void OnFindMissingPlugin(int placeholder_id, const std::string& mime_type); | 30 void OnFindMissingPlugin(int placeholder_id, const std::string& mime_type); |
| 28 | 31 |
| 29 void FoundMissingPlugin(int placeholder_id, | 32 void FoundMissingPlugin(int placeholder_id, |
| 30 const std::string& mime_type, | 33 const std::string& mime_type, |
| 31 PluginInstaller* installer); | 34 PluginInstaller* installer); |
| 32 void DidNotFindMissingPlugin(int placeholder_id, | 35 void DidNotFindMissingPlugin(int placeholder_id, |
| 33 const std::string& mime_type); | 36 const std::string& mime_type); |
| 34 void InstallMissingPlugin(PluginInstaller* installer); | 37 void InstallMissingPlugin(PluginInstaller* installer); |
| 35 | 38 |
| 36 base::WeakPtrFactory<PluginObserver> weak_ptr_factory_; | 39 base::WeakPtrFactory<PluginObserver> weak_ptr_factory_; |
| 37 | 40 |
| 38 TabContentsWrapper* tab_contents_; | 41 TabContentsWrapper* tab_contents_; |
| 39 | 42 |
| 43 ScopedVector<MissingPluginHost> missing_plugins_; |
| 44 |
| 40 DISALLOW_COPY_AND_ASSIGN(PluginObserver); | 45 DISALLOW_COPY_AND_ASSIGN(PluginObserver); |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 #endif // CHROME_BROWSER_PLUGIN_OBSERVER_H_ | 48 #endif // CHROME_BROWSER_PLUGIN_OBSERVER_H_ |
| OLD | NEW |