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

Side by Side Diff: content/browser/devtools/renderer_overrides_handler.cc

Issue 493213004: [DevTools] Implement Inspector.interstitial events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/devtools/renderer_overrides_handler.h" 5 #include "content/browser/devtools/renderer_overrides_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/barrier_closure.h" 10 #include "base/barrier_closure.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 host->AddMouseEventCallback(mouse_event_callback_); 209 host->AddMouseEventCallback(mouse_event_callback_);
210 } 210 }
211 211
212 void RendererOverridesHandler::ClearRenderViewHost() { 212 void RendererOverridesHandler::ClearRenderViewHost() {
213 if (host_) 213 if (host_)
214 host_->RemoveMouseEventCallback(mouse_event_callback_); 214 host_->RemoveMouseEventCallback(mouse_event_callback_);
215 host_ = NULL; 215 host_ = NULL;
216 ResetColorPickerFrame(); 216 ResetColorPickerFrame();
217 } 217 }
218 218
219 void RendererOverridesHandler::DidAttachInterstitialPage() {
220 SendNotification(devtools::Inspector::interstitialShown::kName, NULL);
221 }
222
223 void RendererOverridesHandler::DidDetachInterstitialPage() {
224 SendNotification(devtools::Inspector::interstitialHidden::kName, NULL);
225 }
226
219 void RendererOverridesHandler::InnerSwapCompositorFrame() { 227 void RendererOverridesHandler::InnerSwapCompositorFrame() {
220 if ((base::TimeTicks::Now() - last_frame_time_).InMilliseconds() < 228 if ((base::TimeTicks::Now() - last_frame_time_).InMilliseconds() <
221 kFrameRateThresholdMs) { 229 kFrameRateThresholdMs) {
222 return; 230 return;
223 } 231 }
224 232
225 if (!host_ || !host_->GetView()) 233 if (!host_ || !host_->GetView())
226 return; 234 return;
227 235
228 last_frame_time_ = base::TimeTicks::Now(); 236 last_frame_time_ = base::TimeTicks::Now();
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 return; 1287 return;
1280 bool enabled = touch_emulation_enabled_ || screencast_command_; 1288 bool enabled = touch_emulation_enabled_ || screencast_command_;
1281 host_->SetTouchEventEmulationEnabled(enabled); 1289 host_->SetTouchEventEmulationEnabled(enabled);
1282 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 1290 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
1283 WebContents::FromRenderViewHost(host_)); 1291 WebContents::FromRenderViewHost(host_));
1284 if (web_contents) 1292 if (web_contents)
1285 web_contents->SetForceDisableOverscrollContent(enabled); 1293 web_contents->SetForceDisableOverscrollContent(enabled);
1286 } 1294 }
1287 1295
1288 } // namespace content 1296 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698