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

Side by Side Diff: components/navigation_interception/intercept_navigation_delegate.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase Created 3 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
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 "components/navigation_interception/intercept_navigation_delegate.h" 5 #include "components/navigation_interception/intercept_navigation_delegate.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 } 68 }
69 69
70 } // namespace 70 } // namespace
71 71
72 // static 72 // static
73 void InterceptNavigationDelegate::Associate( 73 void InterceptNavigationDelegate::Associate(
74 WebContents* web_contents, 74 WebContents* web_contents,
75 std::unique_ptr<InterceptNavigationDelegate> delegate) { 75 std::unique_ptr<InterceptNavigationDelegate> delegate) {
76 web_contents->SetUserData(kInterceptNavigationDelegateUserDataKey, 76 web_contents->SetUserData(kInterceptNavigationDelegateUserDataKey,
77 delegate.release()); 77 std::move(delegate));
78 } 78 }
79 79
80 // static 80 // static
81 InterceptNavigationDelegate* InterceptNavigationDelegate::Get( 81 InterceptNavigationDelegate* InterceptNavigationDelegate::Get(
82 WebContents* web_contents) { 82 WebContents* web_contents) {
83 return static_cast<InterceptNavigationDelegate*>( 83 return static_cast<InterceptNavigationDelegate*>(
84 web_contents->GetUserData(kInterceptNavigationDelegateUserDataKey)); 84 web_contents->GetUserData(kInterceptNavigationDelegateUserDataKey));
85 } 85 }
86 86
87 // static 87 // static
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 return Java_InterceptNavigationDelegate_shouldIgnoreNavigation( 140 return Java_InterceptNavigationDelegate_shouldIgnoreNavigation(
141 env, jdelegate, jobject_params); 141 env, jdelegate, jobject_params);
142 } 142 }
143 143
144 void InterceptNavigationDelegate::UpdateLastUserGestureCarryoverTimestamp() { 144 void InterceptNavigationDelegate::UpdateLastUserGestureCarryoverTimestamp() {
145 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); 145 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now();
146 } 146 }
147 147
148 } // namespace navigation_interception 148 } // namespace navigation_interception
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698