| 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 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 WebIntentInlineDispositionDelegate::~WebIntentInlineDispositionDelegate() { | 37 WebIntentInlineDispositionDelegate::~WebIntentInlineDispositionDelegate() { |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool WebIntentInlineDispositionDelegate::IsPopupOrPanel( | 40 bool WebIntentInlineDispositionDelegate::IsPopupOrPanel( |
| 41 const content::WebContents* source) const { | 41 const content::WebContents* source) const { |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool WebIntentInlineDispositionDelegate::ShouldAddNavigationToHistory( | |
| 46 const history::HistoryAddPageArgs& add_page_args, | |
| 47 content::NavigationType navigation_type) { | |
| 48 return false; | |
| 49 } | |
| 50 | |
| 51 content::WebContents* WebIntentInlineDispositionDelegate::OpenURLFromTab( | 45 content::WebContents* WebIntentInlineDispositionDelegate::OpenURLFromTab( |
| 52 content::WebContents* source, const content::OpenURLParams& params) { | 46 content::WebContents* source, const content::OpenURLParams& params) { |
| 53 DCHECK(source); // Can only be invoked from inline disposition. | 47 DCHECK(source); // Can only be invoked from inline disposition. |
| 54 | 48 |
| 55 // Load in place. | 49 // Load in place. |
| 56 source->GetController().LoadURL(params.url, content::Referrer(), | 50 source->GetController().LoadURL(params.url, content::Referrer(), |
| 57 content::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); | 51 content::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); |
| 58 | 52 |
| 59 // Remove previous history entries - users should not navigate in intents. | 53 // Remove previous history entries - users should not navigate in intents. |
| 60 source->GetController().PruneAllButActive(); | 54 source->GetController().PruneAllButActive(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void WebIntentInlineDispositionDelegate::OnRequest( | 110 void WebIntentInlineDispositionDelegate::OnRequest( |
| 117 const ExtensionHostMsg_Request_Params& params) { | 111 const ExtensionHostMsg_Request_Params& params) { |
| 118 extension_function_dispatcher_.Dispatch(params, | 112 extension_function_dispatcher_.Dispatch(params, |
| 119 web_contents_->GetRenderViewHost()); | 113 web_contents_->GetRenderViewHost()); |
| 120 } | 114 } |
| 121 void WebIntentInlineDispositionDelegate::ResizeDueToAutoResize( | 115 void WebIntentInlineDispositionDelegate::ResizeDueToAutoResize( |
| 122 content::WebContents* source, const gfx::Size& pref_size) { | 116 content::WebContents* source, const gfx::Size& pref_size) { |
| 123 DCHECK(picker_); | 117 DCHECK(picker_); |
| 124 picker_->OnInlineDispositionAutoResize(pref_size); | 118 picker_->OnInlineDispositionAutoResize(pref_size); |
| 125 } | 119 } |
| OLD | NEW |