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

Side by Side Diff: content/public/browser/navigation_handle.h

Issue 2101323002: Add 'NavigationHandle::QueueConsoleMessage'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: extensions_unittests Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/public/browser/navigation_throttle.h" 11 #include "content/public/browser/navigation_throttle.h"
12 #include "content/public/common/console_message_level.h"
12 #include "content/public/common/referrer.h" 13 #include "content/public/common/referrer.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "ui/base/page_transition_types.h" 15 #include "ui/base/page_transition_types.h"
15 16
16 class GURL; 17 class GURL;
17 18
18 namespace content { 19 namespace content {
19 class NavigationData; 20 class NavigationData;
20 class NavigationThrottle; 21 class NavigationThrottle;
21 class RenderFrameHost; 22 class RenderFrameHost;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 153
153 // Resumes a navigation that was previously deferred by a NavigationThrottle. 154 // Resumes a navigation that was previously deferred by a NavigationThrottle.
154 virtual void Resume() = 0; 155 virtual void Resume() = 0;
155 156
156 // Cancels a navigation that was previously deferred by a NavigationThrottle. 157 // Cancels a navigation that was previously deferred by a NavigationThrottle.
157 // |result| should be equal to NavigationThrottle::CANCEL or 158 // |result| should be equal to NavigationThrottle::CANCEL or
158 // NavigationThrottle::CANCEL_AND_IGNORE. 159 // NavigationThrottle::CANCEL_AND_IGNORE.
159 virtual void CancelDeferredNavigation( 160 virtual void CancelDeferredNavigation(
160 NavigationThrottle::ThrottleCheckResult result) = 0; 161 NavigationThrottle::ThrottleCheckResult result) = 0;
161 162
163 // Adds a console message to the NavigationHandle's message queue. Messages
164 // queued before the navigation is ready to commit will be delivered to the
165 // final RenderFrameHost upon commit. Messages queued after the navigation has
166 // committed will be delivered immediately.
167 virtual void QueueConsoleMessage(ConsoleMessageLevel level,
clamy 2016/06/28 11:30:38 The policy of content is not to add a method to th
Mike West 2016/06/28 12:22:33 You're right, sorry. I'd convinced myself that htt
168 const std::string& message) = 0;
169
162 // Testing methods ---------------------------------------------------------- 170 // Testing methods ----------------------------------------------------------
163 // 171 //
164 // The following methods should be used exclusively for writing unit tests. 172 // The following methods should be used exclusively for writing unit tests.
165 173
166 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting( 174 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting(
167 const GURL& url, 175 const GURL& url,
168 RenderFrameHost* render_frame_host); 176 RenderFrameHost* render_frame_host);
169 177
170 // Registers a NavigationThrottle for tests. The throttle can 178 // Registers a NavigationThrottle for tests. The throttle can
171 // modify the request, pause the request or cancel the request. This will 179 // modify the request, pause the request or cancel the request. This will
(...skipping 22 matching lines...) Expand all
194 202
195 // The NavigationData that the embedder returned from 203 // The NavigationData that the embedder returned from
196 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will 204 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will
197 // be a clone of the NavigationData. 205 // be a clone of the NavigationData.
198 virtual NavigationData* GetNavigationData() = 0; 206 virtual NavigationData* GetNavigationData() = 0;
199 }; 207 };
200 208
201 } // namespace content 209 } // namespace content
202 210
203 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 211 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698