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

Side by Side Diff: chrome/browser/views/options/content_settings_window_view.cc

Issue 2815042: Add notifications content settings type. (Closed)
Patch Set: '' Created 10 years, 5 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
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 #include "chrome/browser/views/options/content_settings_window_view.h" 5 #include "chrome/browser/views/options/content_settings_window_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 pages_.push_back( 172 pages_.push_back(
173 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_JAVASCRIPT)); 173 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_JAVASCRIPT));
174 pages_.push_back(new PluginFilterPageView(profile_)); 174 pages_.push_back(new PluginFilterPageView(profile_));
175 pages_.push_back( 175 pages_.push_back(
176 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_POPUPS)); 176 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_POPUPS));
177 pages_.push_back( 177 pages_.push_back(
178 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_GEOLOCATION)); 178 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_GEOLOCATION));
179 for (size_t i = 0; i < pages_.size(); ++i) { 179 for (size_t i = 0; i < pages_.size(); ++i) {
180 pages_[i]->set_parent_owned(false); 180 pages_[i]->set_parent_owned(false);
181 } 181 }
182 DCHECK_EQ(static_cast<int>(pages_.size()), CONTENT_SETTINGS_NUM_TYPES); 182 // TODO(thakis): Remove |+ 1| once the notifications pane is done.
183 DCHECK_EQ(static_cast<int>(pages_.size()) + 1, CONTENT_SETTINGS_NUM_TYPES);
183 184
184 std::vector<string16> strings; 185 std::vector<string16> strings;
185 strings.push_back(l10n_util::GetStringUTF16(IDS_COOKIES_TAB_LABEL)); 186 strings.push_back(l10n_util::GetStringUTF16(IDS_COOKIES_TAB_LABEL));
186 strings.push_back(l10n_util::GetStringUTF16(IDS_IMAGES_TAB_LABEL)); 187 strings.push_back(l10n_util::GetStringUTF16(IDS_IMAGES_TAB_LABEL));
187 strings.push_back(l10n_util::GetStringUTF16(IDS_JAVASCRIPT_TAB_LABEL)); 188 strings.push_back(l10n_util::GetStringUTF16(IDS_JAVASCRIPT_TAB_LABEL));
188 strings.push_back(l10n_util::GetStringUTF16(IDS_PLUGIN_TAB_LABEL)); 189 strings.push_back(l10n_util::GetStringUTF16(IDS_PLUGIN_TAB_LABEL));
189 strings.push_back(l10n_util::GetStringUTF16(IDS_POPUP_TAB_LABEL)); 190 strings.push_back(l10n_util::GetStringUTF16(IDS_POPUP_TAB_LABEL));
190 strings.push_back(l10n_util::GetStringUTF16(IDS_GEOLOCATION_TAB_LABEL)); 191 strings.push_back(l10n_util::GetStringUTF16(IDS_GEOLOCATION_TAB_LABEL));
191 listbox_ = new views::Listbox(strings, this); 192 listbox_ = new views::Listbox(strings, this);
192 AddChildView(listbox_); 193 AddChildView(listbox_);
193 CHECK_EQ(strings.size(), pages_.size()); 194 CHECK_EQ(strings.size(), pages_.size());
194 } 195 }
195 196
196 void ContentSettingsWindowView::ShowSettingsPage(int page) { 197 void ContentSettingsWindowView::ShowSettingsPage(int page) {
197 if (pages_[current_page_]->GetParent()) 198 if (pages_[current_page_]->GetParent())
198 RemoveChildView(pages_[current_page_]); 199 RemoveChildView(pages_[current_page_]);
199 current_page_ = page; 200 current_page_ = page;
200 AddChildView(pages_[current_page_]); 201 AddChildView(pages_[current_page_]);
201 Layout(); 202 Layout();
202 SchedulePaint(); 203 SchedulePaint();
203 } 204 }
204 205
205 const OptionsPageView* 206 const OptionsPageView*
206 ContentSettingsWindowView::GetCurrentContentSettingsTabView() const { 207 ContentSettingsWindowView::GetCurrentContentSettingsTabView() const {
207 return static_cast<OptionsPageView*>(pages_[current_page_]); 208 return static_cast<OptionsPageView*>(pages_[current_page_]);
208 } 209 }
OLDNEW
« no previous file with comments | « chrome/browser/views/options/content_filter_page_view.cc ('k') | chrome/common/content_settings_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698