| 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 2554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2565 registry, | 2565 registry, |
| 2566 handler)); | 2566 handler)); |
| 2567 } | 2567 } |
| 2568 } | 2568 } |
| 2569 | 2569 |
| 2570 // static | 2570 // static |
| 2571 void Browser::RegisterIntentHandlerHelper(TabContents* tab, | 2571 void Browser::RegisterIntentHandlerHelper(TabContents* tab, |
| 2572 const string16& action, | 2572 const string16& action, |
| 2573 const string16& type, | 2573 const string16& type, |
| 2574 const string16& href, | 2574 const string16& href, |
| 2575 const string16& title) { | 2575 const string16& title, |
| 2576 const string16& disposition) { |
| 2576 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2577 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
| 2577 tab); | 2578 tab); |
| 2578 if (!tcw || tcw->profile()->IsOffTheRecord()) | 2579 if (!tcw || tcw->profile()->IsOffTheRecord()) |
| 2579 return; | 2580 return; |
| 2580 | 2581 |
| 2581 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 2582 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 2582 return; | 2583 return; |
| 2583 | 2584 |
| 2584 GURL service_url(href); | 2585 GURL service_url(href); |
| 2585 if (!service_url.is_valid()) { | 2586 if (!service_url.is_valid()) { |
| 2586 const GURL& url = tab->GetURL(); | 2587 const GURL& url = tab->GetURL(); |
| 2587 service_url = url.Resolve(href); | 2588 service_url = url.Resolve(href); |
| 2588 } | 2589 } |
| 2589 | 2590 |
| 2590 WebIntentServiceData service; | 2591 WebIntentServiceData service; |
| 2591 service.service_url = service_url; | 2592 service.service_url = service_url; |
| 2592 service.action = action; | 2593 service.action = action; |
| 2593 service.type = type; | 2594 service.type = type; |
| 2594 service.title = title; | 2595 service.title = title; |
| 2596 service.setDisposition(disposition); |
| 2597 |
| 2595 InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); | 2598 InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); |
| 2596 infobar_helper->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate( | 2599 infobar_helper->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate( |
| 2597 infobar_helper, | 2600 infobar_helper, |
| 2598 WebIntentsRegistryFactory::GetForProfile(tcw->profile()), | 2601 WebIntentsRegistryFactory::GetForProfile(tcw->profile()), |
| 2599 service)); | 2602 service)); |
| 2600 } | 2603 } |
| 2601 | 2604 |
| 2602 // static | 2605 // static |
| 2603 void Browser::FindReplyHelper(TabContents* tab, | 2606 void Browser::FindReplyHelper(TabContents* tab, |
| 2604 int request_id, | 2607 int request_id, |
| (...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3948 const std::string& protocol, | 3951 const std::string& protocol, |
| 3949 const GURL& url, | 3952 const GURL& url, |
| 3950 const string16& title) { | 3953 const string16& title) { |
| 3951 RegisterProtocolHandlerHelper(tab, protocol, url, title); | 3954 RegisterProtocolHandlerHelper(tab, protocol, url, title); |
| 3952 } | 3955 } |
| 3953 | 3956 |
| 3954 void Browser::RegisterIntentHandler(TabContents* tab, | 3957 void Browser::RegisterIntentHandler(TabContents* tab, |
| 3955 const string16& action, | 3958 const string16& action, |
| 3956 const string16& type, | 3959 const string16& type, |
| 3957 const string16& href, | 3960 const string16& href, |
| 3958 const string16& title) { | 3961 const string16& title, |
| 3959 RegisterIntentHandlerHelper(tab, action, type, href, title); | 3962 const string16& disposition) { |
| 3963 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); |
| 3960 } | 3964 } |
| 3961 | 3965 |
| 3962 void Browser::WebIntentDispatch(TabContents* tab, | 3966 void Browser::WebIntentDispatch(TabContents* tab, |
| 3963 int routing_id, | 3967 int routing_id, |
| 3964 const webkit_glue::WebIntentData& intent, | 3968 const webkit_glue::WebIntentData& intent, |
| 3965 int intent_id) { | 3969 int intent_id) { |
| 3966 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 3970 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 3967 return; | 3971 return; |
| 3968 | 3972 |
| 3969 TabContentsWrapper* tcw = | 3973 TabContentsWrapper* tcw = |
| (...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5495 } | 5499 } |
| 5496 | 5500 |
| 5497 void Browser::UpdateFullscreenExitBubbleContent() { | 5501 void Browser::UpdateFullscreenExitBubbleContent() { |
| 5498 GURL url; | 5502 GURL url; |
| 5499 if (fullscreened_tab_) | 5503 if (fullscreened_tab_) |
| 5500 url = fullscreened_tab_->tab_contents()->GetURL(); | 5504 url = fullscreened_tab_->tab_contents()->GetURL(); |
| 5501 | 5505 |
| 5502 window_->UpdateFullscreenExitBubbleContent( | 5506 window_->UpdateFullscreenExitBubbleContent( |
| 5503 url, GetFullscreenExitBubbleType()); | 5507 url, GetFullscreenExitBubbleType()); |
| 5504 } | 5508 } |
| OLD | NEW |