Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / web_navigation / web_navigation_api_helpers.h
blob882cf33623c22ffcfab727de40c57654a2864438
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_HELPERS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_HELPERS_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "extensions/browser/extension_event_histogram_value.h"
12 #include "ui/base/page_transition_types.h"
14 namespace content {
15 class BrowserContext;
16 class RenderFrameHost;
17 class WebContents;
20 class GURL;
22 namespace extensions {
24 namespace web_navigation_api_helpers {
26 // Returns the frame ID as it will be passed to the extension:
27 // 0 if the navigation happens in the main frame, or the frame routing ID
28 // otherwise.
29 int GetFrameId(content::RenderFrameHost* frame_host);
31 // Create and dispatch the various events of the webNavigation API.
32 void DispatchOnBeforeNavigate(content::WebContents* web_contents,
33 content::RenderFrameHost* frame_host,
34 const GURL& validated_url);
36 void DispatchOnCommitted(events::HistogramValue histogram_value,
37 const std::string& event_name,
38 content::WebContents* web_contents,
39 content::RenderFrameHost* frame_host,
40 const GURL& url,
41 ui::PageTransition transition_type);
43 void DispatchOnDOMContentLoaded(content::WebContents* web_contents,
44 content::RenderFrameHost* frame_host,
45 const GURL& url);
47 void DispatchOnCompleted(content::WebContents* web_contents,
48 content::RenderFrameHost* frame_host,
49 const GURL& url);
51 void DispatchOnCreatedNavigationTarget(
52 content::WebContents* web_contents,
53 content::BrowserContext* browser_context,
54 content::RenderFrameHost* source_frame_host,
55 content::WebContents* target_web_contents,
56 const GURL& target_url);
58 void DispatchOnErrorOccurred(content::WebContents* web_contents,
59 content::RenderFrameHost* frame_host,
60 const GURL& url,
61 int error_code);
63 void DispatchOnTabReplaced(
64 content::WebContents* old_web_contents,
65 content::BrowserContext* browser_context,
66 content::WebContents* new_web_contents);
68 } // namespace web_navigation_api_helpers
70 } // namespace extensions
72 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_HELPERS_H_