OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 registry, | 2566 registry, |
2567 handler)); | 2567 handler)); |
2568 } | 2568 } |
2569 } | 2569 } |
2570 | 2570 |
2571 // static | 2571 // static |
2572 void Browser::RegisterIntentHandlerHelper(TabContents* tab, | 2572 void Browser::RegisterIntentHandlerHelper(TabContents* tab, |
2573 const string16& action, | 2573 const string16& action, |
2574 const string16& type, | 2574 const string16& type, |
2575 const string16& href, | 2575 const string16& href, |
2576 const string16& title) { | 2576 const string16& title, |
| 2577 const string16& disposition) { |
2577 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2578 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
2578 tab); | 2579 tab); |
2579 if (!tcw || tcw->profile()->IsOffTheRecord()) | 2580 if (!tcw || tcw->profile()->IsOffTheRecord()) |
2580 return; | 2581 return; |
2581 | 2582 |
2582 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 2583 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
2583 return; | 2584 return; |
2584 | 2585 |
2585 GURL service_url(href); | 2586 GURL service_url(href); |
2586 if (!service_url.is_valid()) { | 2587 if (!service_url.is_valid()) { |
2587 const GURL& url = tab->GetURL(); | 2588 const GURL& url = tab->GetURL(); |
2588 service_url = url.Resolve(href); | 2589 service_url = url.Resolve(href); |
2589 } | 2590 } |
2590 | 2591 |
2591 WebIntentServiceData service; | 2592 WebIntentServiceData service; |
2592 service.service_url = service_url; | 2593 service.service_url = service_url; |
2593 service.action = action; | 2594 service.action = action; |
2594 service.type = type; | 2595 service.type = type; |
2595 service.title = title; | 2596 service.title = title; |
| 2597 service.setDisposition(disposition); |
| 2598 |
2596 InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); | 2599 InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); |
2597 infobar_helper->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate( | 2600 infobar_helper->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate( |
2598 infobar_helper, | 2601 infobar_helper, |
2599 WebIntentsRegistryFactory::GetForProfile(tcw->profile()), | 2602 WebIntentsRegistryFactory::GetForProfile(tcw->profile()), |
2600 service)); | 2603 service)); |
2601 } | 2604 } |
2602 | 2605 |
2603 // static | 2606 // static |
2604 void Browser::FindReplyHelper(TabContents* tab, | 2607 void Browser::FindReplyHelper(TabContents* tab, |
2605 int request_id, | 2608 int request_id, |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3967 const std::string& protocol, | 3970 const std::string& protocol, |
3968 const GURL& url, | 3971 const GURL& url, |
3969 const string16& title) { | 3972 const string16& title) { |
3970 RegisterProtocolHandlerHelper(tab, protocol, url, title); | 3973 RegisterProtocolHandlerHelper(tab, protocol, url, title); |
3971 } | 3974 } |
3972 | 3975 |
3973 void Browser::RegisterIntentHandler(TabContents* tab, | 3976 void Browser::RegisterIntentHandler(TabContents* tab, |
3974 const string16& action, | 3977 const string16& action, |
3975 const string16& type, | 3978 const string16& type, |
3976 const string16& href, | 3979 const string16& href, |
3977 const string16& title) { | 3980 const string16& title, |
3978 RegisterIntentHandlerHelper(tab, action, type, href, title); | 3981 const string16& disposition) { |
| 3982 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); |
3979 } | 3983 } |
3980 | 3984 |
3981 void Browser::WebIntentDispatch(TabContents* tab, | 3985 void Browser::WebIntentDispatch(TabContents* tab, |
3982 int routing_id, | 3986 int routing_id, |
3983 const webkit_glue::WebIntentData& intent, | 3987 const webkit_glue::WebIntentData& intent, |
3984 int intent_id) { | 3988 int intent_id) { |
3985 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 3989 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
3986 return; | 3990 return; |
3987 | 3991 |
3988 TabContentsWrapper* tcw = | 3992 TabContentsWrapper* tcw = |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5507 } | 5511 } |
5508 | 5512 |
5509 void Browser::UpdateFullscreenExitBubbleContent() { | 5513 void Browser::UpdateFullscreenExitBubbleContent() { |
5510 GURL url; | 5514 GURL url; |
5511 if (fullscreened_tab_) | 5515 if (fullscreened_tab_) |
5512 url = fullscreened_tab_->tab_contents()->GetURL(); | 5516 url = fullscreened_tab_->tab_contents()->GetURL(); |
5513 | 5517 |
5514 window_->UpdateFullscreenExitBubbleContent( | 5518 window_->UpdateFullscreenExitBubbleContent( |
5515 url, GetFullscreenExitBubbleType()); | 5519 url, GetFullscreenExitBubbleType()); |
5516 } | 5520 } |
OLD | NEW |