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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3951 const string16& title) { | 3951 const string16& title) { |
3952 RegisterProtocolHandlerHelper(tab, protocol, url, title); | 3952 RegisterProtocolHandlerHelper(tab, protocol, url, title); |
3953 } | 3953 } |
3954 | 3954 |
3955 void Browser::RegisterIntentHandler(WebContents* tab, | 3955 void Browser::RegisterIntentHandler(WebContents* tab, |
3956 const string16& action, | 3956 const string16& action, |
3957 const string16& type, | 3957 const string16& type, |
3958 const string16& href, | 3958 const string16& href, |
3959 const string16& title, | 3959 const string16& title, |
3960 const string16& disposition) { | 3960 const string16& disposition) { |
3961 #if defined(ENABLE_WEB_INTENTS) | |
3962 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); | 3961 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); |
3963 #endif | |
3964 } | 3962 } |
3965 | 3963 |
3966 void Browser::WebIntentDispatch( | 3964 void Browser::WebIntentDispatch( |
3967 WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) { | 3965 WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) { |
3968 #if defined(ENABLE_WEB_INTENTS) | |
3969 if (!web_intents::IsWebIntentsEnabled(profile_)) | 3966 if (!web_intents::IsWebIntentsEnabled(profile_)) |
3970 return; | 3967 return; |
3971 | 3968 |
3972 TabContentsWrapper* tcw = | 3969 TabContentsWrapper* tcw = |
3973 TabContentsWrapper::GetCurrentWrapperForContents(tab); | 3970 TabContentsWrapper::GetCurrentWrapperForContents(tab); |
3974 tcw->web_intent_picker_controller()->SetIntentsDispatcher(intents_dispatcher); | 3971 tcw->web_intent_picker_controller()->SetIntentsDispatcher(intents_dispatcher); |
3975 tcw->web_intent_picker_controller()->ShowDialog( | 3972 tcw->web_intent_picker_controller()->ShowDialog( |
3976 intents_dispatcher->GetIntent().action, | 3973 intents_dispatcher->GetIntent().action, |
3977 intents_dispatcher->GetIntent().type); | 3974 intents_dispatcher->GetIntent().type); |
3978 #endif // defined(ENABLE_WEB_INTENTS) | |
3979 } | 3975 } |
3980 | 3976 |
3981 void Browser::UpdatePreferredSize(WebContents* source, | 3977 void Browser::UpdatePreferredSize(WebContents* source, |
3982 const gfx::Size& pref_size) { | 3978 const gfx::Size& pref_size) { |
3983 window_->UpdatePreferredSize(source, pref_size); | 3979 window_->UpdatePreferredSize(source, pref_size); |
3984 } | 3980 } |
3985 | 3981 |
3986 void Browser::ResizeDueToAutoResize(WebContents* source, | 3982 void Browser::ResizeDueToAutoResize(WebContents* source, |
3987 const gfx::Size& new_size) { | 3983 const gfx::Size& new_size) { |
3988 window_->ResizeDueToAutoResize(source, new_size); | 3984 window_->ResizeDueToAutoResize(source, new_size); |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5463 if (contents && !allow_js_access) { | 5459 if (contents && !allow_js_access) { |
5464 contents->web_contents()->GetController().LoadURL( | 5460 contents->web_contents()->GetController().LoadURL( |
5465 target_url, | 5461 target_url, |
5466 content::Referrer(), | 5462 content::Referrer(), |
5467 content::PAGE_TRANSITION_LINK, | 5463 content::PAGE_TRANSITION_LINK, |
5468 std::string()); // No extra headers. | 5464 std::string()); // No extra headers. |
5469 } | 5465 } |
5470 | 5466 |
5471 return contents != NULL; | 5467 return contents != NULL; |
5472 } | 5468 } |
OLD | NEW |