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

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 1372353004: Making structure for ContentSettings and its corresponding strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options/content_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 {"manageHandlers", IDS_HANDLERS_MANAGE}, 345 {"manageHandlers", IDS_HANDLERS_MANAGE},
346 {"exceptionPatternHeader", IDS_EXCEPTIONS_PATTERN_HEADER}, 346 {"exceptionPatternHeader", IDS_EXCEPTIONS_PATTERN_HEADER},
347 {"exceptionBehaviorHeader", IDS_EXCEPTIONS_ACTION_HEADER}, 347 {"exceptionBehaviorHeader", IDS_EXCEPTIONS_ACTION_HEADER},
348 {"exceptionZoomHeader", IDS_EXCEPTIONS_ZOOM_HEADER}, 348 {"exceptionZoomHeader", IDS_EXCEPTIONS_ZOOM_HEADER},
349 {"embeddedOnHost", IDS_EXCEPTIONS_GEOLOCATION_EMBEDDED_ON_HOST}, 349 {"embeddedOnHost", IDS_EXCEPTIONS_GEOLOCATION_EMBEDDED_ON_HOST},
350 // Cookies filter. 350 // Cookies filter.
351 {"cookiesTabLabel", IDS_COOKIES_TAB_LABEL}, 351 {"cookiesTabLabel", IDS_COOKIES_TAB_LABEL},
352 {"cookiesHeader", IDS_COOKIES_HEADER}, 352 {"cookiesHeader", IDS_COOKIES_HEADER},
353 {"cookiesAllow", IDS_COOKIES_ALLOW_RADIO}, 353 {"cookiesAllow", IDS_COOKIES_ALLOW_RADIO},
354 {"cookiesBlock", IDS_COOKIES_BLOCK_RADIO}, 354 {"cookiesBlock", IDS_COOKIES_BLOCK_RADIO},
355 {"cookiesSession", IDS_COOKIES_SESSION_ONLY_RADIO}, 355 {"cookiesSessionOnly", IDS_COOKIES_SESSION_ONLY_RADIO},
356 {"cookiesBlock3rdParty", IDS_COOKIES_BLOCK_3RDPARTY_CHKBOX}, 356 {"cookiesBlock3rdParty", IDS_COOKIES_BLOCK_3RDPARTY_CHKBOX},
357 {"cookiesShowCookies", IDS_COOKIES_SHOW_COOKIES_BUTTON}, 357 {"cookiesShowCookies", IDS_COOKIES_SHOW_COOKIES_BUTTON},
358 {"flashStorageSettings", IDS_FLASH_STORAGE_SETTINGS}, 358 {"flashStorageSettings", IDS_FLASH_STORAGE_SETTINGS},
359 {"flashStorageUrl", IDS_FLASH_STORAGE_URL}, 359 {"flashStorageUrl", IDS_FLASH_STORAGE_URL},
360 #if defined(ENABLE_GOOGLE_NOW) 360 #if defined(ENABLE_GOOGLE_NOW)
361 {"googleGeolocationAccessEnable", 361 {"googleGeolocationAccessEnable",
362 IDS_GEOLOCATION_GOOGLE_ACCESS_ENABLE_CHKBOX}, 362 IDS_GEOLOCATION_GOOGLE_ACCESS_ENABLE_CHKBOX},
363 #endif 363 #endif
364 // Image filter. 364 // Image filter.
365 {"imagesTabLabel", IDS_IMAGES_TAB_LABEL}, 365 {"imagesTabLabel", IDS_IMAGES_TAB_LABEL},
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 ->Get(CONTENT_SETTINGS_TYPE_PLUGINS) 467 ->Get(CONTENT_SETTINGS_TYPE_PLUGINS)
468 ->default_value_pref_name()); 468 ->default_value_pref_name());
469 469
470 int default_value = CONTENT_SETTING_DEFAULT; 470 int default_value = CONTENT_SETTING_DEFAULT;
471 bool success = default_pref->GetAsInteger(&default_value); 471 bool success = default_pref->GetAsInteger(&default_value);
472 DCHECK(success); 472 DCHECK(success);
473 DCHECK_NE(CONTENT_SETTING_DEFAULT, default_value); 473 DCHECK_NE(CONTENT_SETTING_DEFAULT, default_value);
474 474
475 int plugin_ids = default_value == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT ? 475 int plugin_ids = default_value == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT ?
476 IDS_PLUGIN_DETECT_RECOMMENDED_RADIO : IDS_PLUGIN_DETECT_RADIO; 476 IDS_PLUGIN_DETECT_RECOMMENDED_RADIO : IDS_PLUGIN_DETECT_RADIO;
477 localized_strings->SetString("pluginsDetect", 477 localized_strings->SetString("pluginsDetectImportantContent",
478 l10n_util::GetStringUTF16(plugin_ids)); 478 l10n_util::GetStringUTF16(plugin_ids));
479 479
480 RegisterTitle(localized_strings, "contentSettingsPage", 480 RegisterTitle(localized_strings, "contentSettingsPage",
481 IDS_CONTENT_SETTINGS_TITLE); 481 IDS_CONTENT_SETTINGS_TITLE);
482 482
483 // Register titles for each of the individual settings whose exception 483 // Register titles for each of the individual settings whose exception
484 // dialogs will be processed by |ContentSettingsHandler|. 484 // dialogs will be processed by |ContentSettingsHandler|.
485 RegisterTitle(localized_strings, "cookies", 485 RegisterTitle(localized_strings, "cookies",
486 IDS_COOKIES_TAB_LABEL); 486 IDS_COOKIES_TAB_LABEL);
487 RegisterTitle(localized_strings, "images", 487 RegisterTitle(localized_strings, "images",
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 1622
1623 // Exceptions apply only when the feature is enabled. 1623 // Exceptions apply only when the feature is enabled.
1624 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); 1624 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui()));
1625 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1625 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1626 web_ui()->CallJavascriptFunction( 1626 web_ui()->CallJavascriptFunction(
1627 "ContentSettings.enableProtectedContentExceptions", 1627 "ContentSettings.enableProtectedContentExceptions",
1628 base::FundamentalValue(enable_exceptions)); 1628 base::FundamentalValue(enable_exceptions));
1629 } 1629 }
1630 1630
1631 } // namespace options 1631 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698