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_RENDERER_PLUGINS_PLUGIN_UMA_H_ | 5 #ifndef CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ |
6 #define CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ | 6 #define CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 | 13 |
14 // Used to send UMA data about missing plugins to UMA histogram server. Method | 14 // Used to send UMA data about missing plugins to UMA histogram server. Method |
15 // ReportPluginMissing should be called whenever plugin that is not available or | 15 // ReportPluginMissing should be called whenever plugin that is not available or |
16 // enabled is called. We try to determine plugin's type by requested mime type, | 16 // enabled is called. We try to determine plugin's type by requested mime type, |
17 // or, if mime type is unknown, by plugin's src url. | 17 // or, if mime type is unknown, by plugin's src url. |
18 class MissingPluginReporter { | 18 class MissingPluginReporter { |
19 public: | 19 public: |
20 // This must be sync'd with histogram values. | 20 // Make sure the enum list in tools/histogram/histograms.xml is updated with |
21 // any change in this list. | |
21 enum PluginType { | 22 enum PluginType { |
22 WINDOWS_MEDIA_PLAYER = 0, | 23 WINDOWS_MEDIA_PLAYER = 0, |
23 SILVERLIGHT = 1, | 24 SILVERLIGHT = 1, |
24 REALPLAYER = 2, | 25 REALPLAYER = 2, |
25 JAVA = 3, | 26 JAVA = 3, |
26 QUICKTIME = 4, | 27 QUICKTIME = 4, |
27 OTHER = 5 | 28 OTHER = 5, // This is obsolete and replaced by UNSUPPORTED_* types. |
29 BROWSER_PLUGIN = 6, | |
30 SHOCKWAVE_FLASH = 7, | |
31 WIDEVINE_CDM = 8, | |
32 // NOTE: Add new plugin types only immediately above this line. | |
33 UNSUPPORTED_MIMETYPE = 240, | |
34 UNSUPPORTED_EXTENSION = 241, | |
35 // NOTE: Add new unsupported types only immediately above this line. | |
36 PLUGIN_TYPE_MAX | |
ddorwin
2013/04/05 05:32:17
On second thought, any idea if each slot consumes
xhwang
2013/04/05 19:00:09
Moved UNSUPPORTED_* after OTHER to avoid the gap.
| |
28 }; | 37 }; |
29 | 38 |
30 // Sends UMA data, i.e. plugin's type. | 39 // Sends UMA data, i.e. plugin's type. |
31 class UMASender { | 40 class UMASender { |
32 public: | 41 public: |
33 virtual ~UMASender() {} | 42 virtual ~UMASender() {} |
34 virtual void SendPluginUMA(PluginType plugin_type) = 0; | 43 virtual void SendPluginUMA(PluginType plugin_type) = 0; |
35 }; | 44 }; |
36 | 45 |
37 // Returns singleton instance. | 46 // Returns singleton instance. |
(...skipping 23 matching lines...) Expand all Loading... | |
61 // Converts plugin's mime type to plugin type. | 70 // Converts plugin's mime type to plugin type. |
62 PluginType MimeTypeToPluginType(const std::string& mime_type); | 71 PluginType MimeTypeToPluginType(const std::string& mime_type); |
63 | 72 |
64 scoped_ptr<UMASender> report_sender_; | 73 scoped_ptr<UMASender> report_sender_; |
65 | 74 |
66 DISALLOW_COPY_AND_ASSIGN(MissingPluginReporter); | 75 DISALLOW_COPY_AND_ASSIGN(MissingPluginReporter); |
67 }; | 76 }; |
68 | 77 |
69 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ | 78 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ |
70 | 79 |
OLD | NEW |