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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.h

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 | Annotate | Revision Log
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 // Defines the Chrome Extensions WebNavigation API functions for observing and 5 // Defines the Chrome Extensions WebNavigation API functions for observing and
6 // intercepting navigation events, as specified in the extension JSON API. 6 // intercepting navigation events, as specified in the extension JSON API.
7 7
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_
9 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ 9 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 virtual void DidOpenRequestedURL(content::WebContents* new_contents, 90 virtual void DidOpenRequestedURL(content::WebContents* new_contents,
91 const GURL& url, 91 const GURL& url,
92 const content::Referrer& referrer, 92 const content::Referrer& referrer,
93 WindowOpenDisposition disposition, 93 WindowOpenDisposition disposition,
94 content::PageTransition transition, 94 content::PageTransition transition,
95 int64 source_frame_num) OVERRIDE; 95 int64 source_frame_num) OVERRIDE;
96 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; 96 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
97 97
98 private: 98 private:
99 explicit WebNavigationTabObserver(content::WebContents* web_contents); 99 explicit WebNavigationTabObserver(content::WebContents* web_contents);
100 static int kUserDataKey;
101 friend class WebContentsUserData<WebNavigationTabObserver>; 100 friend class WebContentsUserData<WebNavigationTabObserver>;
102 101
103 // True if the transition and target url correspond to a reference fragment 102 // True if the transition and target url correspond to a reference fragment
104 // navigation. 103 // navigation.
105 bool IsReferenceFragmentNavigation(FrameNavigationState::FrameID frame_id, 104 bool IsReferenceFragmentNavigation(FrameNavigationState::FrameID frame_id,
106 const GURL& url); 105 const GURL& url);
107 106
108 // Creates and sends onErrorOccurred events for all on-going navigations. If 107 // Creates and sends onErrorOccurred events for all on-going navigations. If
109 // |render_view_host| is non-NULL, only generates events for frames in this 108 // |render_view_host| is non-NULL, only generates events for frames in this
110 // render view host. If |id_to_skip| is given, no events are sent for that 109 // render view host. If |id_to_skip| is given, no events are sent for that
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // API function that returns the states of all frames in a given tab. 210 // API function that returns the states of all frames in a given tab.
212 class GetAllFramesFunction : public SyncExtensionFunction { 211 class GetAllFramesFunction : public SyncExtensionFunction {
213 virtual ~GetAllFramesFunction() {} 212 virtual ~GetAllFramesFunction() {}
214 virtual bool RunImpl() OVERRIDE; 213 virtual bool RunImpl() OVERRIDE;
215 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") 214 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames")
216 }; 215 };
217 216
218 } // namespace extensions 217 } // namespace extensions
219 218
220 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ 219 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698