Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/content_exceptions_table_model.h

Issue 3446013: Refcount the host content settings map from the content exceptions table model. (Closed)
Patch Set: updates Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/content_exceptions_table_model_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CONTENT_EXCEPTIONS_TABLE_MODEL_H_ 5 #ifndef CHROME_BROWSER_CONTENT_EXCEPTIONS_TABLE_MODEL_H_
6 #define CHROME_BROWSER_CONTENT_EXCEPTIONS_TABLE_MODEL_H_ 6 #define CHROME_BROWSER_CONTENT_EXCEPTIONS_TABLE_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "app/table_model.h" 11 #include "app/table_model.h"
12 #include "base/ref_counted.h"
12 #include "chrome/common/content_settings.h" 13 #include "chrome/common/content_settings.h"
13 #include "chrome/common/content_settings_types.h" 14 #include "chrome/common/content_settings_types.h"
14 #include "chrome/browser/host_content_settings_map.h" 15 #include "chrome/browser/host_content_settings_map.h"
15 16
16 class ContentExceptionsTableModel : public TableModel { 17 class ContentExceptionsTableModel : public TableModel {
17 public: 18 public:
18 ContentExceptionsTableModel(HostContentSettingsMap* map, 19 ContentExceptionsTableModel(HostContentSettingsMap* map,
19 HostContentSettingsMap* off_the_record_map, 20 HostContentSettingsMap* off_the_record_map,
20 ContentSettingsType content_type); 21 ContentSettingsType content_type);
21 22
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 virtual void SetObserver(TableModelObserver* observer); 57 virtual void SetObserver(TableModelObserver* observer);
57 58
58 private: 59 private:
59 HostContentSettingsMap* map(bool is_off_the_record) { 60 HostContentSettingsMap* map(bool is_off_the_record) {
60 return is_off_the_record ? off_the_record_map_ : map_; 61 return is_off_the_record ? off_the_record_map_ : map_;
61 } 62 }
62 HostContentSettingsMap::SettingsForOneType& entries(bool is_off_the_record) { 63 HostContentSettingsMap::SettingsForOneType& entries(bool is_off_the_record) {
63 return is_off_the_record ? off_the_record_entries_ : entries_; 64 return is_off_the_record ? off_the_record_entries_ : entries_;
64 } 65 }
65 66
66 HostContentSettingsMap* map_; 67 scoped_refptr<HostContentSettingsMap> map_;
67 HostContentSettingsMap* off_the_record_map_; 68 scoped_refptr<HostContentSettingsMap> off_the_record_map_;
68 ContentSettingsType content_type_; 69 ContentSettingsType content_type_;
69 HostContentSettingsMap::SettingsForOneType entries_; 70 HostContentSettingsMap::SettingsForOneType entries_;
70 HostContentSettingsMap::SettingsForOneType off_the_record_entries_; 71 HostContentSettingsMap::SettingsForOneType off_the_record_entries_;
71 TableModelObserver* observer_; 72 TableModelObserver* observer_;
72 73
73 DISALLOW_COPY_AND_ASSIGN(ContentExceptionsTableModel); 74 DISALLOW_COPY_AND_ASSIGN(ContentExceptionsTableModel);
74 }; 75 };
75 76
76 #endif // CHROME_BROWSER_CONTENT_EXCEPTIONS_TABLE_MODEL_H_ 77 #endif // CHROME_BROWSER_CONTENT_EXCEPTIONS_TABLE_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/content_exceptions_table_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698