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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1153793003: Add user_gesture param to WebContentsImpl::Activate Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update callers Created 5 years, 7 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 | « content/browser/web_contents/web_contents_impl.h ('k') | 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 // 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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 std::set<RenderWidgetHostView*> set; 1319 std::set<RenderWidgetHostView*> set;
1320 if (ShowingInterstitialPage()) { 1320 if (ShowingInterstitialPage()) {
1321 set.insert(GetRenderWidgetHostView()); 1321 set.insert(GetRenderWidgetHostView());
1322 } else { 1322 } else {
1323 ForEachFrame( 1323 ForEachFrame(
1324 base::Bind(&AddRenderWidgetHostViewToSet, base::Unretained(&set))); 1324 base::Bind(&AddRenderWidgetHostViewToSet, base::Unretained(&set)));
1325 } 1325 }
1326 return set; 1326 return set;
1327 } 1327 }
1328 1328
1329 void WebContentsImpl::Activate() { 1329 void WebContentsImpl::Activate(bool user_gesture) {
1330 if (delegate_) 1330 if (delegate_)
1331 delegate_->ActivateContents(this); 1331 delegate_->ActivateContents(this);
1332 } 1332 }
1333 1333
1334 void WebContentsImpl::Deactivate() { 1334 void WebContentsImpl::Deactivate() {
1335 if (delegate_) 1335 if (delegate_)
1336 delegate_->DeactivateContents(this); 1336 delegate_->DeactivateContents(this);
1337 } 1337 }
1338 1338
1339 void WebContentsImpl::LostCapture() { 1339 void WebContentsImpl::LostCapture() {
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 if (delegate_) 3170 if (delegate_)
3171 delegate_->VisibleSSLStateChanged(this); 3171 delegate_->VisibleSSLStateChanged(this);
3172 } 3172 }
3173 3173
3174 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() { 3174 void WebContentsImpl::NotifyBeforeFormRepostWarningShow() {
3175 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3175 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3176 BeforeFormRepostWarningShow()); 3176 BeforeFormRepostWarningShow());
3177 } 3177 }
3178 3178
3179 void WebContentsImpl::ActivateAndShowRepostFormWarningDialog() { 3179 void WebContentsImpl::ActivateAndShowRepostFormWarningDialog() {
3180 Activate(); 3180 // TODO(johnme): Can we sometimes be certain this was for a user gesture?
3181 Activate(false /* user_gesture */);
3181 if (delegate_) 3182 if (delegate_)
3182 delegate_->ShowRepostFormWarningDialog(this); 3183 delegate_->ShowRepostFormWarningDialog(this);
3183 } 3184 }
3184 3185
3185 bool WebContentsImpl::HasAccessedInitialDocument() { 3186 bool WebContentsImpl::HasAccessedInitialDocument() {
3186 return has_accessed_initial_document_; 3187 return has_accessed_initial_document_;
3187 } 3188 }
3188 3189
3189 // Notifies the RenderWidgetHost instance about the fact that the page is 3190 // Notifies the RenderWidgetHost instance about the fact that the page is
3190 // loading, or done loading. 3191 // loading, or done loading.
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
4389 player_map->erase(it); 4390 player_map->erase(it);
4390 } 4391 }
4391 4392
4392 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4393 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4393 force_disable_overscroll_content_ = force_disable; 4394 force_disable_overscroll_content_ = force_disable;
4394 if (view_) 4395 if (view_)
4395 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4396 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4396 } 4397 }
4397 4398
4398 } // namespace content 4399 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698