Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // PageNavigator defines an interface that can be used to express the user's | 5 // PageNavigator defines an interface that can be used to express the user's |
| 6 // intention to navigate to a particular URL. The implementing class should | 6 // intention to navigate to a particular URL. The implementing class should |
| 7 // perform the navigation. | 7 // perform the navigation. |
| 8 | 8 |
| 9 #ifndef CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 9 #ifndef CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
| 10 #define CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 10 #define CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/public/browser/global_request_id.h" | 16 #include "content/public/browser/global_request_id.h" |
| 17 #include "content/public/browser/render_frame_host.h" | |
| 17 #include "content/public/browser/site_instance.h" | 18 #include "content/public/browser/site_instance.h" |
| 18 #include "content/public/common/referrer.h" | 19 #include "content/public/common/referrer.h" |
| 19 #include "content/public/common/resource_request_body.h" | 20 #include "content/public/common/resource_request_body.h" |
| 20 #include "ui/base/page_transition_types.h" | 21 #include "ui/base/page_transition_types.h" |
| 21 #include "ui/base/window_open_disposition.h" | 22 #include "ui/base/window_open_disposition.h" |
| 22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 | 26 |
| 26 class WebContents; | 27 class WebContents; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 bool started_from_context_menu; | 93 bool started_from_context_menu; |
| 93 | 94 |
| 94 private: | 95 private: |
| 95 OpenURLParams(); | 96 OpenURLParams(); |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 class PageNavigator { | 99 class PageNavigator { |
| 99 public: | 100 public: |
| 100 virtual ~PageNavigator() {} | 101 virtual ~PageNavigator() {} |
| 101 | 102 |
| 103 // Opens a URL with the given parameters. | |
| 104 virtual void RequestOpenURL(RenderFrameHost* render_frame_host, | |
|
Charlie Reis
2017/02/02 23:34:22
I think we'll need to find a way to improve this p
| |
| 105 const OpenURLParams& params) {} | |
| 106 | |
| 102 // Opens a URL with the given disposition. The transition specifies how this | 107 // Opens a URL with the given disposition. The transition specifies how this |
| 103 // navigation should be recorded in the history system (for example, typed). | 108 // navigation should be recorded in the history system (for example, typed). |
| 104 // Returns the WebContents the URL is opened in, or nullptr if the URL wasn't | 109 // Returns the WebContents the URL is opened in, or nullptr if the URL wasn't |
| 105 // opened immediately. | 110 // opened immediately. |
| 106 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; | 111 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; |
| 107 }; | 112 }; |
| 108 | 113 |
| 109 } // namespace content | 114 } // namespace content |
| 110 | 115 |
| 111 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 116 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
| OLD | NEW |