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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 146683003: Settings should not call into inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 10 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 | « Source/core/inspector/InspectorInstrumentation.idl ('k') | Source/core/page/Page.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } 773 }
774 774
775 void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandl er::Result::Enum* status) 775 void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandl er::Result::Enum* status)
776 { 776 {
777 bool disabledByScriptController = false; 777 bool disabledByScriptController = false;
778 bool disabledInSettings = false; 778 bool disabledInSettings = false;
779 Frame* frame = mainFrame(); 779 Frame* frame = mainFrame();
780 if (frame) { 780 if (frame) {
781 disabledByScriptController = !frame->script().canExecuteScripts(NotAbout ToExecuteScript); 781 disabledByScriptController = !frame->script().canExecuteScripts(NotAbout ToExecuteScript);
782 if (frame->settings()) 782 if (frame->settings())
783 disabledInSettings = !frame->settings()->isScriptEnabled(); 783 disabledInSettings = !frame->settings()->scriptEnabled();
784 } 784 }
785 785
786 if (!disabledByScriptController) { 786 if (!disabledByScriptController) {
787 *status = PageCommandHandler::Result::Allowed; 787 *status = PageCommandHandler::Result::Allowed;
788 return; 788 return;
789 } 789 }
790 790
791 if (disabledInSettings) 791 if (disabledInSettings)
792 *status = PageCommandHandler::Result::Disabled; 792 *status = PageCommandHandler::Result::Disabled;
793 else 793 else
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 } 1268 }
1269 1269
1270 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1270 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1271 { 1271 {
1272 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1272 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1273 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1273 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1274 } 1274 }
1275 1275
1276 } // namespace WebCore 1276 } // namespace WebCore
1277 1277
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInstrumentation.idl ('k') | Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698