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

Side by Side Diff: Source/core/testing/InternalSettings.cpp

Issue 870933002: Make it possible to set the display mode from the WebView API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Using enum now Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 372
373 settings()->setAvailablePointerTypes(pointerTypes); 373 settings()->setAvailablePointerTypes(pointerTypes);
374 } 374 }
375 375
376 void InternalSettings::setDisplayModeOverride(const String& displayMode, Excepti onState& exceptionState) 376 void InternalSettings::setDisplayModeOverride(const String& displayMode, Excepti onState& exceptionState)
377 { 377 {
378 InternalSettingsGuardForSettings(); 378 InternalSettingsGuardForSettings();
379 String token = displayMode.stripWhiteSpace(); 379 String token = displayMode.stripWhiteSpace();
380 380
381 DisplayMode mode = DisplayModeBrowser; 381 WebDisplayMode mode = WebDisplayModeBrowser;
382 if (token == "browser") 382 if (token == "browser")
383 mode = DisplayModeBrowser; 383 mode = WebDisplayModeBrowser;
384 else if (token == "minimal-ui") 384 else if (token == "minimal-ui")
385 mode = DisplayModeMinimalUi; 385 mode = WebDisplayModeMinimalUi;
386 else if (token == "standalone") 386 else if (token == "standalone")
387 mode = DisplayModeStandalone; 387 mode = WebDisplayModeStandalone;
388 else if (token == "fullscreen") 388 else if (token == "fullscreen")
389 mode = DisplayModeFullscreen; 389 mode = WebDisplayModeFullscreen;
390 else 390 else
391 exceptionState.throwDOMException(SyntaxError, "The display-mode token (' " + token + ")' is invalid."); 391 exceptionState.throwDOMException(SyntaxError, "The display-mode token (' " + token + ")' is invalid.");
392 392
393 settings()->setDisplayModeOverride(mode); 393 settings()->setDisplayModeOverride(mode);
394 } 394 }
395 395
396 void InternalSettings::setPrimaryPointerType(const String& pointer, ExceptionSta te& exceptionState) 396 void InternalSettings::setPrimaryPointerType(const String& pointer, ExceptionSta te& exceptionState)
397 { 397 {
398 InternalSettingsGuardForSettings(); 398 InternalSettingsGuardForSettings();
399 String token = pointer.stripWhiteSpace(); 399 String token = pointer.stripWhiteSpace();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 if (equalIgnoringCase(policy, "allowed")) 461 if (equalIgnoringCase(policy, "allowed"))
462 settings()->setImageAnimationPolicy(ImageAnimationPolicyAllowed); 462 settings()->setImageAnimationPolicy(ImageAnimationPolicyAllowed);
463 else if (equalIgnoringCase(policy, "once")) 463 else if (equalIgnoringCase(policy, "once"))
464 settings()->setImageAnimationPolicy(ImageAnimationPolicyAnimateOnce); 464 settings()->setImageAnimationPolicy(ImageAnimationPolicyAnimateOnce);
465 else if (equalIgnoringCase(policy, "none")) 465 else if (equalIgnoringCase(policy, "none"))
466 settings()->setImageAnimationPolicy(ImageAnimationPolicyNoAnimation); 466 settings()->setImageAnimationPolicy(ImageAnimationPolicyNoAnimation);
467 else 467 else
468 exceptionState.throwDOMException(SyntaxError, "The image animation polic y provided ('" + policy + "') is invalid."); 468 exceptionState.throwDOMException(SyntaxError, "The image animation polic y provided ('" + policy + "') is invalid.");
469 } 469 }
470 } 470 }
OLDNEW
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698