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

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

Issue 8549011: Content settings UI for mouse lock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Strings from Brian used Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 { "notifications_block", IDS_NOTIFICATIONS_BLOCK_RADIO }, 259 { "notifications_block", IDS_NOTIFICATIONS_BLOCK_RADIO },
260 // Intents filter. 260 // Intents filter.
261 { "intentsTabLabel", IDS_INTENTS_TAB_LABEL }, 261 { "intentsTabLabel", IDS_INTENTS_TAB_LABEL },
262 { "intentsAllow", IDS_INTENTS_ALLOW_RADIO }, 262 { "intentsAllow", IDS_INTENTS_ALLOW_RADIO },
263 { "intentsAsk", IDS_INTENTS_ASK_RADIO }, 263 { "intentsAsk", IDS_INTENTS_ASK_RADIO },
264 { "intentsBlock", IDS_INTENTS_BLOCK_RADIO }, 264 { "intentsBlock", IDS_INTENTS_BLOCK_RADIO },
265 { "intents_header", IDS_INTENTS_HEADER }, 265 { "intents_header", IDS_INTENTS_HEADER },
266 // Fullscreen filter. 266 // Fullscreen filter.
267 { "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL }, 267 { "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL },
268 { "fullscreen_header", IDS_FULLSCREEN_HEADER }, 268 { "fullscreen_header", IDS_FULLSCREEN_HEADER },
269 // Mouse Lock filter.
270 { "mouselock_tab_label", IDS_MOUSE_LOCK_TAB_LABEL },
271 { "mouselock_header", IDS_MOUSE_LOCK_HEADER },
272 { "mouselock_allow", IDS_MOUSE_LOCK_ALLOW_RADIO },
273 { "mouselock_ask", IDS_MOUSE_LOCK_ASK_RADIO },
274 { "mouselock_block", IDS_MOUSE_LOCK_BLOCK_RADIO },
269 }; 275 };
270 276
271 RegisterStrings(localized_strings, resources, arraysize(resources)); 277 RegisterStrings(localized_strings, resources, arraysize(resources));
272 RegisterTitle(localized_strings, "contentSettingsPage", 278 RegisterTitle(localized_strings, "contentSettingsPage",
273 IDS_CONTENT_SETTINGS_TITLE); 279 IDS_CONTENT_SETTINGS_TITLE);
274 localized_strings->SetBoolean("enable_click_to_play", 280 localized_strings->SetBoolean("enable_click_to_play",
275 CommandLine::ForCurrentProcess()->HasSwitch( 281 CommandLine::ForCurrentProcess()->HasSwitch(
276 switches::kEnableClickToPlay)); 282 switches::kEnableClickToPlay));
277 localized_strings->SetBoolean("enable_web_intents", 283 localized_strings->SetBoolean("enable_web_intents",
278 CommandLine::ForCurrentProcess()->HasSwitch( 284 CommandLine::ForCurrentProcess()->HasSwitch(
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 415 }
410 416
411 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { 417 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() {
412 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; 418 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1;
413 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { 419 type < CONTENT_SETTINGS_NUM_TYPES; ++type) {
414 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE 420 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE
415 // is supposed to be set by policy only. Hence there is no user facing UI 421 // is supposed to be set by policy only. Hence there is no user facing UI
416 // for this content type and we skip it here. 422 // for this content type and we skip it here.
417 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) 423 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE)
418 continue; 424 continue;
419 // TODO(scheib): Mouse lock content settings UI. http://crbug.com/97768
420 if (type == CONTENT_SETTINGS_TYPE_MOUSELOCK)
421 continue;
422 UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); 425 UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type));
423 } 426 }
424 } 427 }
425 428
426 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { 429 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() {
427 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; 430 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1;
428 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { 431 type < CONTENT_SETTINGS_NUM_TYPES; ++type) {
429 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); 432 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type));
430 } 433 }
431 } 434 }
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); 827 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry();
825 } 828 }
826 829
827 HostContentSettingsMap* 830 HostContentSettingsMap*
828 ContentSettingsHandler::GetOTRContentSettingsMap() { 831 ContentSettingsHandler::GetOTRContentSettingsMap() {
829 Profile* profile = Profile::FromWebUI(web_ui_); 832 Profile* profile = Profile::FromWebUI(web_ui_);
830 if (profile->HasOffTheRecordProfile()) 833 if (profile->HasOffTheRecordProfile())
831 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); 834 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap();
832 return NULL; 835 return NULL;
833 } 836 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698