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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2352753002: Collect more UMA data about dialogs and site engagement. (Closed)
Patch Set: nit Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, 2258 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type,
2259 const base::string16& message, 2259 const base::string16& message,
2260 const base::string16& default_value, 2260 const base::string16& default_value,
2261 const GURL& frame_url, 2261 const GURL& frame_url,
2262 base::string16* result) { 2262 base::string16* result) {
2263 // Don't allow further dialogs if we are waiting to swap out, since the 2263 // Don't allow further dialogs if we are waiting to swap out, since the
2264 // ScopedPageLoadDeferrer in our stack prevents it. 2264 // ScopedPageLoadDeferrer in our stack prevents it.
2265 if (suppress_further_dialogs_) 2265 if (suppress_further_dialogs_)
2266 return false; 2266 return false;
2267 2267
2268 int32_t message_length = static_cast<int32_t>(message.length());
2269 if (WebUserGestureIndicator::processedUserGestureSinceLoad()) {
2270 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.UserGestureSinceLoad",
2271 message_length);
2272 } else {
2273 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.NoUserGestureSinceLoad",
2274 message_length);
2275 }
2276
2268 bool success = false; 2277 bool success = false;
2269 base::string16 result_temp; 2278 base::string16 result_temp;
2270 if (!result) 2279 if (!result)
2271 result = &result_temp; 2280 result = &result_temp;
2272 2281
2273 Send(new FrameHostMsg_RunJavaScriptMessage( 2282 Send(new FrameHostMsg_RunJavaScriptMessage(
2274 routing_id_, message, default_value, frame_url, type, &success, result)); 2283 routing_id_, message, default_value, frame_url, type, &success, result));
2275 return success; 2284 return success;
2276 } 2285 }
2277 2286
(...skipping 4111 matching lines...) Expand 10 before | Expand all | Expand 10 after
6389 // event target. Potentially a Pepper plugin will receive the event. 6398 // event target. Potentially a Pepper plugin will receive the event.
6390 // In order to tell whether a plugin gets the last mouse event and which it 6399 // In order to tell whether a plugin gets the last mouse event and which it
6391 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6400 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6392 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6401 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6393 // |pepper_last_mouse_event_target_|. 6402 // |pepper_last_mouse_event_target_|.
6394 pepper_last_mouse_event_target_ = nullptr; 6403 pepper_last_mouse_event_target_ = nullptr;
6395 #endif 6404 #endif
6396 } 6405 }
6397 6406
6398 } // namespace content 6407 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | third_party/WebKit/Source/web/WebUserGestureIndicator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698