diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-15 15:38:44 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-15 15:38:44 +0000 |
commit | 0cd07f946c353e33d0b9474d383ab06612e40bd8 (patch) | |
tree | c3b05021da46c9f489d5b359f53a3e3f36f02ae7 /chrome/browser/mock_plugin_exceptions_table_model.h | |
parent | e19f6b1bb2e8d09ae7471f10d56c834a250182c5 (diff) | |
download | chromium_src-0cd07f946c353e33d0b9474d383ab06612e40bd8.zip chromium_src-0cd07f946c353e33d0b9474d383ab06612e40bd8.tar.gz chromium_src-0cd07f946c353e33d0b9474d383ab06612e40bd8.tar.bz2 |
[Mac] Add per-plugin exceptions to content settings.
Screenshot: http://www.dropmocks.com/mXMd
I'm adding a subclass of NSArrayController, TableModelArrayController, that binds to a RemoveRowsTableModel that can use groups and displays them using group rows in an NSTableView. This cleans up SimpleContentExceptionsWindowController a lot, and the class could also be used for other table models that use groups (keyword editor and autofill).
XIB changes: In SimpleContentExceptionsWindow.xib, bind table view to TableModelArrayController instead of using the dataSource outlet. Buttons call actions on TableModelArrayController, and table view delegate also points to it.
BUG=39252
TEST=SimpleContentExceptionsWindowControllerTest.*:TableModelArrayControllerTest.*:PluginExceptionsTableModelTest.*
Review URL: http://codereview.chromium.org/3327016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mock_plugin_exceptions_table_model.h')
-rw-r--r-- | chrome/browser/mock_plugin_exceptions_table_model.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/mock_plugin_exceptions_table_model.h b/chrome/browser/mock_plugin_exceptions_table_model.h new file mode 100644 index 0000000..4cedcd3 --- /dev/null +++ b/chrome/browser/mock_plugin_exceptions_table_model.h @@ -0,0 +1,29 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_MOCK_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ +#define CHROME_BROWSER_MOCK_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ +#pragma once + +#include <vector> + +#include "chrome/browser/plugin_exceptions_table_model.h" + +class MockPluginExceptionsTableModel : public PluginExceptionsTableModel { + public: + MockPluginExceptionsTableModel(HostContentSettingsMap* map, + HostContentSettingsMap* otr_map) + : PluginExceptionsTableModel(map, otr_map) {} + virtual ~MockPluginExceptionsTableModel() {} + + void set_plugins(const std::vector<WebPluginInfo>& plugins); + + protected: + virtual void GetPlugins(std::vector<WebPluginInfo>* plugins); + + private: + std::vector<WebPluginInfo> plugins_; +}; + +#endif // CHROME_BROWSER_MOCK_PLUGIN_EXCEPTIONS_TABLE_MODEL_H_ |