chromeos: bluetooth: tie Proxy lifetime to object, not observer
[chromium-blink-merge.git] / chrome / browser / plugin_observer.h
blob4000fce92015b8595a84d1e82cf846994bb3e017
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PLUGIN_OBSERVER_H_
6 #define CHROME_BROWSER_PLUGIN_OBSERVER_H_
7 #pragma once
9 #include "base/memory/weak_ptr.h"
10 #include "content/public/browser/web_contents_observer.h"
12 #if defined(ENABLE_PLUGIN_INSTALLATION)
13 #include <map>
14 #endif
16 class GURL;
17 class InfoBarDelegate;
18 class PluginInstaller;
19 class TabContentsWrapper;
21 #if defined(ENABLE_PLUGIN_INSTALLATION)
22 class PluginInstaller;
23 #endif
25 class PluginObserver : public content::WebContentsObserver {
26 public:
27 explicit PluginObserver(TabContentsWrapper* tab_contents);
28 virtual ~PluginObserver();
30 // content::WebContentsObserver implementation.
31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
33 private:
34 #if defined(ENABLE_PLUGIN_INSTALLATION)
35 class PluginPlaceholderHost;
36 #endif
38 void OnBlockedOutdatedPlugin(const string16& name, const GURL& update_url);
39 void OnBlockedUnauthorizedPlugin(const string16& name);
40 #if defined(ENABLE_PLUGIN_INSTALLATION)
41 void OnFindMissingPlugin(int placeholder_id, const std::string& mime_type);
43 void FoundMissingPlugin(int placeholder_id,
44 const std::string& mime_type,
45 PluginInstaller* installer);
46 void DidNotFindMissingPlugin(int placeholder_id);
47 void InstallMissingPlugin(PluginInstaller* installer);
48 #endif
49 void OnOpenAboutPlugins();
50 void OnRemovePluginPlaceholderHost(int placeholder_id);
52 base::WeakPtrFactory<PluginObserver> weak_ptr_factory_;
54 TabContentsWrapper* tab_contents_;
56 #if defined(ENABLE_PLUGIN_INSTALLATION)
57 // Stores all PluginPlaceholderHosts, keyed by their routing ID.
58 std::map<int, PluginPlaceholderHost*> plugin_placeholders_;
59 #endif
61 DISALLOW_COPY_AND_ASSIGN(PluginObserver);
64 #endif // CHROME_BROWSER_PLUGIN_OBSERVER_H_