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

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

Issue 362773003: [DevTools] Explicitly enable/disable Page.viewportChanged protocol event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bound to setDeviceMetricsOverride Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 1159
1160 void InspectorPageAgent::didScroll() 1160 void InspectorPageAgent::didScroll()
1161 { 1161 {
1162 if (m_enabled) 1162 if (m_enabled)
1163 m_overlay->update(); 1163 m_overlay->update();
1164 viewportChanged(); 1164 viewportChanged();
1165 } 1165 }
1166 1166
1167 void InspectorPageAgent::viewportChanged() 1167 void InspectorPageAgent::viewportChanged()
1168 { 1168 {
1169 if (!m_enabled) 1169 if (!m_enabled || !m_deviceMetricsOverridden)
1170 return; 1170 return;
1171 IntSize contentsSize = m_page->deprecatedLocalMainFrame()->view()->contentsS ize(); 1171 IntSize contentsSize = m_page->deprecatedLocalMainFrame()->view()->contentsS ize();
1172 IntRect viewRect = m_page->deprecatedLocalMainFrame()->view()->visibleConten tRect(); 1172 IntRect viewRect = m_page->deprecatedLocalMainFrame()->view()->visibleConten tRect();
1173 RefPtr<TypeBuilder::Page::Viewport> viewport = TypeBuilder::Page::Viewport:: create() 1173 RefPtr<TypeBuilder::Page::Viewport> viewport = TypeBuilder::Page::Viewport:: create()
1174 .setScrollX(viewRect.x()) 1174 .setScrollX(viewRect.x())
1175 .setScrollY(viewRect.y()) 1175 .setScrollY(viewRect.y())
1176 .setContentsWidth(contentsSize.width()) 1176 .setContentsWidth(contentsSize.width())
1177 .setContentsHeight(contentsSize.height()) 1177 .setContentsHeight(contentsSize.height())
1178 .setPageScaleFactor(m_page->pageScaleFactor()); 1178 .setPageScaleFactor(m_page->pageScaleFactor());
1179 m_frontend->viewportChanged(viewport); 1179 m_frontend->viewportChanged(viewport);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent) 1427 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent)
1428 { 1428 {
1429 if (!m_editedResourceContent.contains(url)) 1429 if (!m_editedResourceContent.contains(url))
1430 return false; 1430 return false;
1431 *content = m_editedResourceContent.get(url); 1431 *content = m_editedResourceContent.get(url);
1432 return true; 1432 return true;
1433 } 1433 }
1434 1434
1435 } // namespace WebCore 1435 } // namespace WebCore
1436 1436
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698