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

Side by Side Diff: chrome/browser/download/download_request_limiter.cc

Issue 1748553002: Replace MouseWheel events with GestureScrollBegin in WebContentsObserver::DidGetUserInteraction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-didgetusergesture
Patch Set: Addressing reviewer comments Created 4 years, 9 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 | « no previous file | chrome/browser/download/download_request_limiter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/download/download_request_limiter.h" 5 #include "chrome/browser/download/download_request_limiter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // See also the initial_page_host_ logic in Observe() for 92 // See also the initial_page_host_ logic in Observe() for
93 // NOTIFICATION_NAV_ENTRY_PENDING. 93 // NOTIFICATION_NAV_ENTRY_PENDING.
94 break; 94 break;
95 default: 95 default:
96 NOTREACHED(); 96 NOTREACHED();
97 } 97 }
98 } 98 }
99 99
100 void DownloadRequestLimiter::TabDownloadState::DidGetUserInteraction( 100 void DownloadRequestLimiter::TabDownloadState::DidGetUserInteraction(
101 const blink::WebInputEvent::Type type) { 101 const blink::WebInputEvent::Type type) {
102 if (is_showing_prompt() || type == blink::WebInputEvent::MouseWheel) { 102 if (is_showing_prompt() || type == blink::WebInputEvent::GestureScrollBegin) {
103 // Don't change state if a prompt is showing or if the user has scrolled. 103 // Don't change state if a prompt is showing or if the user has scrolled.
104 return; 104 return;
105 } 105 }
106 106
107 #if BUILDFLAG(ANDROID_JAVA_UI) 107 #if BUILDFLAG(ANDROID_JAVA_UI)
108 bool promptable = InfoBarService::FromWebContents(web_contents()) != nullptr; 108 bool promptable = InfoBarService::FromWebContents(web_contents()) != nullptr;
109 #else 109 #else
110 bool promptable = 110 bool promptable =
111 PermissionBubbleManager::FromWebContents(web_contents()) != nullptr; 111 PermissionBubbleManager::FromWebContents(web_contents()) != nullptr;
112 #endif 112 #endif
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 NOTREACHED(); 488 NOTREACHED();
489 } 489 }
490 } 490 }
491 491
492 void DownloadRequestLimiter::Remove(TabDownloadState* state, 492 void DownloadRequestLimiter::Remove(TabDownloadState* state,
493 content::WebContents* contents) { 493 content::WebContents* contents) {
494 DCHECK(ContainsKey(state_map_, contents)); 494 DCHECK(ContainsKey(state_map_, contents));
495 state_map_.erase(contents); 495 state_map_.erase(contents);
496 delete state; 496 delete state;
497 } 497 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_request_limiter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698