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" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Returns singleton instance. | 52 // Returns singleton instance. |
53 static PluginUMAReporter* GetInstance(); | 53 static PluginUMAReporter* GetInstance(); |
54 | 54 |
55 void ReportPluginMissing(const std::string& plugin_mime_type, | 55 void ReportPluginMissing(const std::string& plugin_mime_type, |
56 const GURL& plugin_src); | 56 const GURL& plugin_src); |
57 | 57 |
58 void ReportPluginDisabled(const std::string& plugin_mime_type, | 58 void ReportPluginDisabled(const std::string& plugin_mime_type, |
59 const GURL& plugin_src); | 59 const GURL& plugin_src); |
60 | 60 |
61 private: | 61 private: |
62 friend struct DefaultSingletonTraits<PluginUMAReporter>; | 62 friend struct base::DefaultSingletonTraits<PluginUMAReporter>; |
63 friend class PluginUMATest; | 63 friend class PluginUMATest; |
64 | 64 |
65 PluginUMAReporter(); | 65 PluginUMAReporter(); |
66 ~PluginUMAReporter(); | 66 ~PluginUMAReporter(); |
67 | 67 |
68 static bool CompareCStrings(const char* first, const char* second); | 68 static bool CompareCStrings(const char* first, const char* second); |
69 bool CStringArrayContainsCString(const char* const* array, | 69 bool CStringArrayContainsCString(const char* const* array, |
70 size_t array_size, | 70 size_t array_size, |
71 const char* str); | 71 const char* str); |
72 // Extracts file extension from url. | 72 // Extracts file extension from url. |
73 void ExtractFileExtension(const GURL& src, std::string* extension); | 73 void ExtractFileExtension(const GURL& src, std::string* extension); |
74 | 74 |
75 PluginType GetPluginType(const std::string& plugin_mime_type, | 75 PluginType GetPluginType(const std::string& plugin_mime_type, |
76 const GURL& plugin_src); | 76 const GURL& plugin_src); |
77 | 77 |
78 // Converts plugin's src to plugin type. | 78 // Converts plugin's src to plugin type. |
79 PluginType SrcToPluginType(const GURL& src); | 79 PluginType SrcToPluginType(const GURL& src); |
80 // Converts plugin's mime type to plugin type. | 80 // Converts plugin's mime type to plugin type. |
81 PluginType MimeTypeToPluginType(const std::string& mime_type); | 81 PluginType MimeTypeToPluginType(const std::string& mime_type); |
82 | 82 |
83 scoped_ptr<UMASender> report_sender_; | 83 scoped_ptr<UMASender> report_sender_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(PluginUMAReporter); | 85 DISALLOW_COPY_AND_ASSIGN(PluginUMAReporter); |
86 }; | 86 }; |
87 | 87 |
88 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ | 88 #endif // CHROME_RENDERER_PLUGINS_PLUGIN_UMA_H_ |
OLD | NEW |