| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXCEPTIONS_TABLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ | 6 #define CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> |
| 11 #include <vector> |
| 10 | 12 |
| 11 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 12 #include "chrome/browser/remove_rows_table_model.h" | 14 #include "chrome/browser/remove_rows_table_model.h" |
| 13 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
| 14 #include "webkit/glue/plugins/plugin_list.h" | 16 #include "webkit/glue/plugins/plugin_list.h" |
| 15 | 17 |
| 16 namespace plugin_test_internal { | 18 namespace plugin_test_internal { |
| 17 class PluginExceptionsTableModelTest; | 19 class PluginExceptionsTableModelTest; |
| 18 } | 20 } |
| 19 struct WebPluginInfo; | 21 struct WebPluginInfo; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 42 virtual Groups GetGroups(); | 44 virtual Groups GetGroups(); |
| 43 virtual int GetGroupID(int row); | 45 virtual int GetGroupID(int row); |
| 44 | 46 |
| 45 // NotificationObserver methods: | 47 // NotificationObserver methods: |
| 46 virtual void Observe(NotificationType type, | 48 virtual void Observe(NotificationType type, |
| 47 const NotificationSource& source, | 49 const NotificationSource& source, |
| 48 const NotificationDetails& details); | 50 const NotificationDetails& details); |
| 49 | 51 |
| 50 protected: | 52 protected: |
| 51 // Subclasses can override this method for testing. | 53 // Subclasses can override this method for testing. |
| 52 virtual void GetPlugins(NPAPI::PluginList::PluginMap* plugins); | 54 virtual std::vector<PluginGroup> GetPlugins(); |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 friend class plugin_test_internal::PluginExceptionsTableModelTest; | 57 friend class plugin_test_internal::PluginExceptionsTableModelTest; |
| 56 | 58 |
| 57 struct SettingsEntry { | 59 struct SettingsEntry { |
| 58 HostContentSettingsMap::Pattern pattern; | 60 HostContentSettingsMap::Pattern pattern; |
| 59 int plugin_id; | 61 int plugin_id; |
| 60 ContentSetting setting; | 62 ContentSetting setting; |
| 61 bool is_otr; | 63 bool is_otr; |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 void ClearSettings(); | 66 void ClearSettings(); |
| 65 void ReloadSettings(); | 67 void ReloadSettings(); |
| 66 | 68 |
| 67 scoped_refptr<HostContentSettingsMap> map_; | 69 scoped_refptr<HostContentSettingsMap> map_; |
| 68 scoped_refptr<HostContentSettingsMap> otr_map_; | 70 scoped_refptr<HostContentSettingsMap> otr_map_; |
| 69 | 71 |
| 70 std::deque<SettingsEntry> settings_; | 72 std::deque<SettingsEntry> settings_; |
| 71 std::deque<int> row_counts_; | 73 std::deque<int> row_counts_; |
| 72 std::deque<std::string> resources_; | 74 std::deque<std::string> resources_; |
| 73 TableModel::Groups groups_; | 75 TableModel::Groups groups_; |
| 74 | 76 |
| 75 NotificationRegistrar registrar_; | 77 NotificationRegistrar registrar_; |
| 76 bool updates_disabled_; | 78 bool updates_disabled_; |
| 77 TableModelObserver* observer_; | 79 TableModelObserver* observer_; |
| 78 | 80 |
| 79 DISALLOW_COPY_AND_ASSIGN(PluginExceptionsTableModel); | 81 DISALLOW_COPY_AND_ASSIGN(PluginExceptionsTableModel); |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 #endif // CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ | 84 #endif // CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ |
| OLD | NEW |