| 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 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" | 5 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 10 #include "chrome/browser/ui/intents/web_intent_picker.h" | 10 #include "chrome/browser/ui/intents/web_intent_picker.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 content::NavigationType navigation_type) { | 47 content::NavigationType navigation_type) { |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 content::WebContents* WebIntentInlineDispositionDelegate::OpenURLFromTab( | 51 content::WebContents* WebIntentInlineDispositionDelegate::OpenURLFromTab( |
| 52 content::WebContents* source, const content::OpenURLParams& params) { | 52 content::WebContents* source, const content::OpenURLParams& params) { |
| 53 DCHECK(source); // Can only be invoked from inline disposition. | 53 DCHECK(source); // Can only be invoked from inline disposition. |
| 54 | 54 |
| 55 // Load in place. | 55 // Load in place. |
| 56 source->GetController().LoadURL(params.url, content::Referrer(), | 56 source->GetController().LoadURL(params.url, content::Referrer(), |
| 57 content::PAGE_TRANSITION_START_PAGE, std::string()); | 57 content::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); |
| 58 | 58 |
| 59 // Remove previous history entries - users should not navigate in intents. | 59 // Remove previous history entries - users should not navigate in intents. |
| 60 source->GetController().PruneAllButActive(); | 60 source->GetController().PruneAllButActive(); |
| 61 | 61 |
| 62 return source; | 62 return source; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void WebIntentInlineDispositionDelegate::AddNewContents( | 65 void WebIntentInlineDispositionDelegate::AddNewContents( |
| 66 content::WebContents* source, | 66 content::WebContents* source, |
| 67 content::WebContents* new_contents, | 67 content::WebContents* new_contents, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void WebIntentInlineDispositionDelegate::OnRequest( | 115 void WebIntentInlineDispositionDelegate::OnRequest( |
| 116 const ExtensionHostMsg_Request_Params& params) { | 116 const ExtensionHostMsg_Request_Params& params) { |
| 117 extension_function_dispatcher_.Dispatch(params, | 117 extension_function_dispatcher_.Dispatch(params, |
| 118 web_contents_->GetRenderViewHost()); | 118 web_contents_->GetRenderViewHost()); |
| 119 } | 119 } |
| 120 void WebIntentInlineDispositionDelegate::ResizeDueToAutoResize( | 120 void WebIntentInlineDispositionDelegate::ResizeDueToAutoResize( |
| 121 content::WebContents* source, const gfx::Size& pref_size) { | 121 content::WebContents* source, const gfx::Size& pref_size) { |
| 122 DCHECK(picker_); | 122 DCHECK(picker_); |
| 123 picker_->OnInlineDispositionAutoResize(pref_size); | 123 picker_->OnInlineDispositionAutoResize(pref_size); |
| 124 } | 124 } |
| OLD | NEW |