Chromium Code Reviews| 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. | |
| 21 enum PluginType { | 20 enum PluginType { |
| 22 WINDOWS_MEDIA_PLAYER = 0, | 21 WINDOWS_MEDIA_PLAYER = 0, |
| 23 SILVERLIGHT = 1, | 22 SILVERLIGHT = 1, |
| 24 REALPLAYER = 2, | 23 REALPLAYER = 2, |
| 25 JAVA = 3, | 24 JAVA = 3, |
| 26 QUICKTIME = 4, | 25 QUICKTIME = 4, |
| 27 OTHER = 5 | 26 OTHER = 5, |
|
xhwang
2013/04/03 23:36:55
This is hacky. I don't want to touch the current h
Bernhard Bauer
2013/04/04 07:01:56
Haha, guess we should have initially defined OTHER
xhwang
2013/04/05 00:58:18
Agreed. I don't want to change the existing histog
Bernhard Bauer
2013/04/05 13:29:09
No, I meant there is no need to write out the actu
| |
| 27 SHOCKWAVE_FLASH = 6, | |
| 28 WIDEVINE_CDM = 7, | |
|
ddorwin
2013/04/04 19:52:24
If you're trying to reduce "other", I suggest also
xhwang
2013/04/05 00:58:18
Done.
| |
| 29 // NOTE: Add new plugin types only immediately above this line. Also, make | |
| 30 // sure the enum list in tools/histogram/histograms.xml is updated with any | |
| 31 // change here. | |
| 32 PLUGIN_TYPE_MAX | |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 // Sends UMA data, i.e. plugin's type. | 35 // Sends UMA data, i.e. plugin's type. |
| 31 class UMASender { | 36 class UMASender { |
| 32 public: | 37 public: |
| 33 virtual ~UMASender() {} | 38 virtual ~UMASender() {} |
| 34 virtual void SendPluginUMA(PluginType plugin_type) = 0; | 39 virtual void SendPluginUMA(PluginType plugin_type) = 0; |
| 35 }; | 40 }; |
| 36 | 41 |
| 37 // Returns singleton instance. | 42 // Returns singleton instance. |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 61 // Converts plugin's mime type to plugin type. | 66 // Converts plugin's mime type to plugin type. |
| 62 PluginType MimeTypeToPluginType(const std::string& mime_type); | 67 PluginType MimeTypeToPluginType(const std::string& mime_type); |
| 63 | 68 |
| 64 scoped_ptr<UMASender> report_sender_; | 69 scoped_ptr<UMASender> report_sender_; |
| 65 | 70 |
| 66 DISALLOW_COPY_AND_ASSIGN(MissingPluginReporter); | 71 DISALLOW_COPY_AND_ASSIGN(MissingPluginReporter); |
| 67 }; | 72 }; |
| 68 | 73 |
| 69 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ | 74 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ |
| 70 | 75 |
| OLD | NEW |