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 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2826 } | 2826 } |
2827 } | 2827 } |
2828 | 2828 |
2829 // static | 2829 // static |
2830 void Browser::RegisterIntentHandlerHelper(WebContents* tab, | 2830 void Browser::RegisterIntentHandlerHelper(WebContents* tab, |
2831 const string16& action, | 2831 const string16& action, |
2832 const string16& type, | 2832 const string16& type, |
2833 const string16& href, | 2833 const string16& href, |
2834 const string16& title, | 2834 const string16& title, |
2835 const string16& disposition) { | 2835 const string16& disposition) { |
2836 // TODO(yfriedman): remove OS_ANDROID clause when browser is excluded from | |
2837 // Android build. | |
2838 #if defined(OS_ANDROID) | |
2839 return; | |
2840 #else | |
2836 if (!web_intents::IsWebIntentsEnabled()) | 2841 if (!web_intents::IsWebIntentsEnabled()) |
2837 return; | 2842 return; |
2838 | 2843 |
2839 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2844 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
2840 tab); | 2845 tab); |
2841 if (!tcw || tcw->profile()->IsOffTheRecord()) | 2846 if (!tcw || tcw->profile()->IsOffTheRecord()) |
2842 return; | 2847 return; |
2843 | 2848 |
2844 FaviconService* favicon_service = | 2849 FaviconService* favicon_service = |
2845 tcw->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 2850 tcw->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); |
(...skipping 11 matching lines...) Expand all Loading... | |
2857 service.type = type; | 2862 service.type = type; |
2858 service.title = title; | 2863 service.title = title; |
2859 service.setDisposition(disposition); | 2864 service.setDisposition(disposition); |
2860 | 2865 |
2861 RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar( | 2866 RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar( |
2862 tcw->infobar_tab_helper(), | 2867 tcw->infobar_tab_helper(), |
2863 WebIntentsRegistryFactory::GetForProfile(tcw->profile()), | 2868 WebIntentsRegistryFactory::GetForProfile(tcw->profile()), |
2864 service, | 2869 service, |
2865 favicon_service, | 2870 favicon_service, |
2866 tab->GetURL()); | 2871 tab->GetURL()); |
2872 #endif | |
James Hawkins
2012/03/08 05:21:22
// defined(OS_ANDROID)
Here and elsewhere.
Jesse Greenwald
2012/03/08 18:35:28
Done.
| |
2867 } | 2873 } |
2868 | 2874 |
2869 // static | 2875 // static |
2870 void Browser::FindReplyHelper(WebContents* tab, | 2876 void Browser::FindReplyHelper(WebContents* tab, |
2871 int request_id, | 2877 int request_id, |
2872 int number_of_matches, | 2878 int number_of_matches, |
2873 const gfx::Rect& selection_rect, | 2879 const gfx::Rect& selection_rect, |
2874 int active_match_ordinal, | 2880 int active_match_ordinal, |
2875 bool final_update) { | 2881 bool final_update) { |
2876 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2882 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4176 const string16& action, | 4182 const string16& action, |
4177 const string16& type, | 4183 const string16& type, |
4178 const string16& href, | 4184 const string16& href, |
4179 const string16& title, | 4185 const string16& title, |
4180 const string16& disposition) { | 4186 const string16& disposition) { |
4181 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); | 4187 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); |
4182 } | 4188 } |
4183 | 4189 |
4184 void Browser::WebIntentDispatch( | 4190 void Browser::WebIntentDispatch( |
4185 WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) { | 4191 WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) { |
4192 // TODO(yfriedman): remove OS_ANDROID clause when browser is excluded from | |
4193 // Android build. | |
4194 #if !defined(OS_ANDROID) | |
4186 if (!web_intents::IsWebIntentsEnabled()) | 4195 if (!web_intents::IsWebIntentsEnabled()) |
4187 return; | 4196 return; |
4188 | 4197 |
4189 TabContentsWrapper* tcw = | 4198 TabContentsWrapper* tcw = |
4190 TabContentsWrapper::GetCurrentWrapperForContents(tab); | 4199 TabContentsWrapper::GetCurrentWrapperForContents(tab); |
4191 tcw->web_intent_picker_controller()->SetIntentsDispatcher(intents_dispatcher); | 4200 tcw->web_intent_picker_controller()->SetIntentsDispatcher(intents_dispatcher); |
4192 tcw->web_intent_picker_controller()->ShowDialog( | 4201 tcw->web_intent_picker_controller()->ShowDialog( |
4193 this, | 4202 this, |
4194 intents_dispatcher->GetIntent().action, | 4203 intents_dispatcher->GetIntent().action, |
4195 intents_dispatcher->GetIntent().type); | 4204 intents_dispatcher->GetIntent().type); |
4205 #endif | |
4196 } | 4206 } |
4197 | 4207 |
4198 void Browser::FindReply(WebContents* tab, | 4208 void Browser::FindReply(WebContents* tab, |
4199 int request_id, | 4209 int request_id, |
4200 int number_of_matches, | 4210 int number_of_matches, |
4201 const gfx::Rect& selection_rect, | 4211 const gfx::Rect& selection_rect, |
4202 int active_match_ordinal, | 4212 int active_match_ordinal, |
4203 bool final_update) { | 4213 bool final_update) { |
4204 FindReplyHelper(tab, request_id, number_of_matches, selection_rect, | 4214 FindReplyHelper(tab, request_id, number_of_matches, selection_rect, |
4205 active_match_ordinal, final_update); | 4215 active_match_ordinal, final_update); |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5608 ShowSingletonTabOverwritingNTP(params); | 5618 ShowSingletonTabOverwritingNTP(params); |
5609 } else { | 5619 } else { |
5610 LoginUIServiceFactory::GetForProfile( | 5620 LoginUIServiceFactory::GetForProfile( |
5611 profile()->GetOriginalProfile())->ShowLoginUI(); | 5621 profile()->GetOriginalProfile())->ShowLoginUI(); |
5612 } | 5622 } |
5613 } | 5623 } |
5614 | 5624 |
5615 void Browser::ToggleSpeechInput() { | 5625 void Browser::ToggleSpeechInput() { |
5616 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5626 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5617 } | 5627 } |
OLD | NEW |