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> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
| 13 #include "base/compiler_specific.h" |
13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 14 #include "chrome/browser/content_settings/host_content_settings_map.h" |
14 #include "chrome/browser/remove_rows_table_model.h" | 15 #include "chrome/browser/remove_rows_table_model.h" |
15 #include "chrome/common/notification_observer.h" | 16 #include "chrome/common/notification_observer.h" |
16 #include "webkit/plugins/npapi/plugin_list.h" | 17 #include "webkit/plugins/npapi/plugin_list.h" |
17 | 18 |
18 struct WebPluginInfo; | 19 struct WebPluginInfo; |
19 | 20 |
20 class PluginExceptionsTableModel : public RemoveRowsTableModel, | 21 class PluginExceptionsTableModel : public RemoveRowsTableModel, |
21 public NotificationObserver { | 22 public NotificationObserver { |
22 public: | 23 public: |
23 PluginExceptionsTableModel(HostContentSettingsMap* content_settings_map, | 24 PluginExceptionsTableModel(HostContentSettingsMap* content_settings_map, |
24 HostContentSettingsMap* otr_content_settings_map); | 25 HostContentSettingsMap* otr_content_settings_map); |
25 virtual ~PluginExceptionsTableModel(); | 26 virtual ~PluginExceptionsTableModel(); |
26 | 27 |
27 // Load plugin exceptions from the HostContentSettingsMaps. You should call | 28 // Load plugin exceptions from the HostContentSettingsMaps. You should call |
28 // this method after creating a new PluginExceptionsTableModel. | 29 // this method after creating a new PluginExceptionsTableModel. |
29 void LoadSettings(); | 30 void LoadSettings(); |
30 | 31 |
31 // RemoveRowsTableModel methods: | 32 // RemoveRowsTableModel methods: |
32 virtual bool CanRemoveRows(const Rows& rows) const; | 33 virtual bool CanRemoveRows(const Rows& rows) const; |
33 virtual void RemoveRows(const Rows& rows); | 34 virtual void RemoveRows(const Rows& rows); |
34 virtual void RemoveAll(); | 35 virtual void RemoveAll(); |
35 | 36 |
36 // TableModel methods: | 37 // TableModel methods: |
37 virtual int RowCount(); | 38 virtual int RowCount() OVERRIDE; |
38 virtual std::wstring GetText(int row, int column_id); | 39 virtual string16 GetText(int row, int column_id) OVERRIDE; |
39 virtual void SetObserver(TableModelObserver* observer); | 40 virtual void SetObserver(TableModelObserver* observer) OVERRIDE; |
40 virtual bool HasGroups(); | 41 virtual bool HasGroups() OVERRIDE; |
41 virtual Groups GetGroups(); | 42 virtual Groups GetGroups() OVERRIDE; |
42 virtual int GetGroupID(int row); | 43 virtual int GetGroupID(int row) OVERRIDE; |
43 | 44 |
44 // NotificationObserver methods: | 45 // NotificationObserver methods: |
45 virtual void Observe(NotificationType type, | 46 virtual void Observe(NotificationType type, |
46 const NotificationSource& source, | 47 const NotificationSource& source, |
47 const NotificationDetails& details); | 48 const NotificationDetails& details); |
48 | 49 |
49 protected: | 50 protected: |
50 // Subclasses can override this method for testing. | 51 // Subclasses can override this method for testing. |
51 virtual void GetPlugins( | 52 virtual void GetPlugins( |
52 std::vector<webkit::npapi::PluginGroup>* plugin_groups); | 53 std::vector<webkit::npapi::PluginGroup>* plugin_groups); |
(...skipping 20 matching lines...) Expand all Loading... |
73 TableModel::Groups groups_; | 74 TableModel::Groups groups_; |
74 | 75 |
75 NotificationRegistrar registrar_; | 76 NotificationRegistrar registrar_; |
76 bool updates_disabled_; | 77 bool updates_disabled_; |
77 TableModelObserver* observer_; | 78 TableModelObserver* observer_; |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(PluginExceptionsTableModel); | 80 DISALLOW_COPY_AND_ASSIGN(PluginExceptionsTableModel); |
80 }; | 81 }; |
81 | 82 |
82 #endif // CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ | 83 #endif // CHROME_BROWSER_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ |
OLD | NEW |