| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/custom_launcher_page_contents.h" | 5 #include "apps/custom_launcher_page_contents.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 extensions::SetViewType(web_contents(), extensions::VIEW_TYPE_LAUNCHER_PAGE); | 49 extensions::SetViewType(web_contents(), extensions::VIEW_TYPE_LAUNCHER_PAGE); |
| 50 | 50 |
| 51 // This observer will activate the extension when it is navigated to, which | 51 // This observer will activate the extension when it is navigated to, which |
| 52 // allows Dispatcher to give it the proper context and makes it behave like an | 52 // allows Dispatcher to give it the proper context and makes it behave like an |
| 53 // extension. | 53 // extension. |
| 54 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 54 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 55 web_contents()); | 55 web_contents()); |
| 56 | 56 |
| 57 web_contents_->GetController().LoadURL(url, | 57 web_contents_->GetController().LoadURL(url, |
| 58 content::Referrer(), | 58 content::Referrer(), |
| 59 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 59 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 60 std::string()); | 60 std::string()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 content::WebContents* CustomLauncherPageContents::OpenURLFromTab( | 63 content::WebContents* CustomLauncherPageContents::OpenURLFromTab( |
| 64 content::WebContents* source, | 64 content::WebContents* source, |
| 65 const content::OpenURLParams& params) { | 65 const content::OpenURLParams& params) { |
| 66 DCHECK_EQ(web_contents_.get(), source); | 66 DCHECK_EQ(web_contents_.get(), source); |
| 67 return helper_->OpenURLFromTab(params); | 67 return helper_->OpenURLFromTab(params); |
| 68 } | 68 } |
| 69 | 69 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return web_contents(); | 154 return web_contents(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void CustomLauncherPageContents::OnRequest( | 157 void CustomLauncherPageContents::OnRequest( |
| 158 const ExtensionHostMsg_Request_Params& params) { | 158 const ExtensionHostMsg_Request_Params& params) { |
| 159 extension_function_dispatcher_->Dispatch(params, | 159 extension_function_dispatcher_->Dispatch(params, |
| 160 web_contents_->GetRenderViewHost()); | 160 web_contents_->GetRenderViewHost()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace apps | 163 } // namespace apps |
| OLD | NEW |