| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 #include "grit/locale_settings.h" | 145 #include "grit/locale_settings.h" |
| 146 #include "grit/theme_resources_standard.h" | 146 #include "grit/theme_resources_standard.h" |
| 147 #include "net/base/cookie_monster.h" | 147 #include "net/base/cookie_monster.h" |
| 148 #include "net/base/net_util.h" | 148 #include "net/base/net_util.h" |
| 149 #include "net/base/registry_controlled_domain.h" | 149 #include "net/base/registry_controlled_domain.h" |
| 150 #include "net/url_request/url_request_context.h" | 150 #include "net/url_request/url_request_context.h" |
| 151 #include "ui/base/animation/animation.h" | 151 #include "ui/base/animation/animation.h" |
| 152 #include "ui/base/l10n/l10n_util.h" | 152 #include "ui/base/l10n/l10n_util.h" |
| 153 #include "ui/gfx/point.h" | 153 #include "ui/gfx/point.h" |
| 154 #include "webkit/glue/webkit_glue.h" | 154 #include "webkit/glue/webkit_glue.h" |
| 155 #include "webkit/glue/web_intent_data.h" |
| 155 #include "webkit/glue/window_open_disposition.h" | 156 #include "webkit/glue/window_open_disposition.h" |
| 156 | 157 |
| 157 #if defined(OS_WIN) | 158 #if defined(OS_WIN) |
| 158 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" | 159 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" |
| 159 #include "chrome/browser/shell_integration.h" | 160 #include "chrome/browser/shell_integration.h" |
| 160 #include "chrome/browser/ssl/ssl_error_info.h" | 161 #include "chrome/browser/ssl/ssl_error_info.h" |
| 161 #include "chrome/browser/task_manager/task_manager.h" | 162 #include "chrome/browser/task_manager/task_manager.h" |
| 162 #include "chrome/browser/ui/view_ids.h" | 163 #include "chrome/browser/ui/view_ids.h" |
| 163 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 164 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 164 #include "ui/base/win/shell.h" | 165 #include "ui/base/win/shell.h" |
| (...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2495 | 2496 |
| 2496 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 2497 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 2497 return; | 2498 return; |
| 2498 | 2499 |
| 2499 GURL service_url(href); | 2500 GURL service_url(href); |
| 2500 if (!service_url.is_valid()) { | 2501 if (!service_url.is_valid()) { |
| 2501 const GURL& url = tab->GetURL(); | 2502 const GURL& url = tab->GetURL(); |
| 2502 service_url = url.Resolve(href); | 2503 service_url = url.Resolve(href); |
| 2503 } | 2504 } |
| 2504 | 2505 |
| 2505 WebIntentData intent; | 2506 WebIntentServiceData service; |
| 2506 intent.service_url = service_url; | 2507 service.service_url = service_url; |
| 2507 intent.action = action; | 2508 service.action = action; |
| 2508 intent.type = type; | 2509 service.type = type; |
| 2509 intent.title = title; | 2510 service.title = title; |
| 2510 tcw->infobar_tab_helper()->AddInfoBar( | 2511 tcw->infobar_tab_helper()->AddInfoBar( |
| 2511 new RegisterIntentHandlerInfoBarDelegate(tab, intent)); | 2512 new RegisterIntentHandlerInfoBarDelegate(tab, service)); |
| 2512 } | 2513 } |
| 2513 | 2514 |
| 2514 // static | 2515 // static |
| 2515 void Browser::FindReplyHelper(TabContents* tab, | 2516 void Browser::FindReplyHelper(TabContents* tab, |
| 2516 int request_id, | 2517 int request_id, |
| 2517 int number_of_matches, | 2518 int number_of_matches, |
| 2518 const gfx::Rect& selection_rect, | 2519 const gfx::Rect& selection_rect, |
| 2519 int active_match_ordinal, | 2520 int active_match_ordinal, |
| 2520 bool final_update) { | 2521 bool final_update) { |
| 2521 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2522 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3829 void Browser::RegisterIntentHandler(TabContents* tab, | 3830 void Browser::RegisterIntentHandler(TabContents* tab, |
| 3830 const string16& action, | 3831 const string16& action, |
| 3831 const string16& type, | 3832 const string16& type, |
| 3832 const string16& href, | 3833 const string16& href, |
| 3833 const string16& title) { | 3834 const string16& title) { |
| 3834 RegisterIntentHandlerHelper(tab, action, type, href, title); | 3835 RegisterIntentHandlerHelper(tab, action, type, href, title); |
| 3835 } | 3836 } |
| 3836 | 3837 |
| 3837 void Browser::WebIntentDispatch(TabContents* tab, | 3838 void Browser::WebIntentDispatch(TabContents* tab, |
| 3838 int routing_id, | 3839 int routing_id, |
| 3839 const string16& action, | 3840 const webkit_glue::WebIntentData& intent, |
| 3840 const string16& type, | |
| 3841 const string16& data, | |
| 3842 int intent_id) { | 3841 int intent_id) { |
| 3843 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 3842 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 3844 return; | 3843 return; |
| 3845 | 3844 |
| 3846 TabContentsWrapper* tcw = | 3845 TabContentsWrapper* tcw = |
| 3847 TabContentsWrapper::GetCurrentWrapperForContents(tab); | 3846 TabContentsWrapper::GetCurrentWrapperForContents(tab); |
| 3848 | 3847 |
| 3849 tcw->web_intent_picker_controller()->ShowDialog(window()->GetNativeHandle(), | 3848 tcw->web_intent_picker_controller()->ShowDialog(window()->GetNativeHandle(), |
| 3850 action, type); | 3849 intent.action, intent.type); |
| 3851 } | 3850 } |
| 3852 | 3851 |
| 3853 void Browser::FindReply(TabContents* tab, | 3852 void Browser::FindReply(TabContents* tab, |
| 3854 int request_id, | 3853 int request_id, |
| 3855 int number_of_matches, | 3854 int number_of_matches, |
| 3856 const gfx::Rect& selection_rect, | 3855 const gfx::Rect& selection_rect, |
| 3857 int active_match_ordinal, | 3856 int active_match_ordinal, |
| 3858 bool final_update) { | 3857 bool final_update) { |
| 3859 FindReplyHelper(tab, request_id, number_of_matches, selection_rect, | 3858 FindReplyHelper(tab, request_id, number_of_matches, selection_rect, |
| 3860 active_match_ordinal, final_update); | 3859 active_match_ordinal, final_update); |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5238 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5237 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 5239 if (service->HasSyncSetupCompleted()) | 5238 if (service->HasSyncSetupCompleted()) |
| 5240 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5239 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 5241 else | 5240 else |
| 5242 service->ShowLoginDialog(); | 5241 service->ShowLoginDialog(); |
| 5243 } | 5242 } |
| 5244 | 5243 |
| 5245 void Browser::ToggleSpeechInput() { | 5244 void Browser::ToggleSpeechInput() { |
| 5246 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); | 5245 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); |
| 5247 } | 5246 } |
| OLD | NEW |