| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 84 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 85 #include "chrome/browser/ui/browser_dialogs.h" | 85 #include "chrome/browser/ui/browser_dialogs.h" |
| 86 #include "chrome/browser/ui/browser_list.h" | 86 #include "chrome/browser/ui/browser_list.h" |
| 87 #include "chrome/browser/ui/browser_navigator.h" | 87 #include "chrome/browser/ui/browser_navigator.h" |
| 88 #include "chrome/browser/ui/browser_synced_window_delegate.h" | 88 #include "chrome/browser/ui/browser_synced_window_delegate.h" |
| 89 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 89 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 90 #include "chrome/browser/ui/browser_window.h" | 90 #include "chrome/browser/ui/browser_window.h" |
| 91 #include "chrome/browser/ui/find_bar/find_bar.h" | 91 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 92 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 92 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 93 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 93 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 94 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | |
| 95 #include "chrome/browser/ui/omnibox/location_bar.h" | 94 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 96 #include "chrome/browser/ui/panels/panel.h" | 95 #include "chrome/browser/ui/panels/panel.h" |
| 97 #include "chrome/browser/ui/panels/panel_manager.h" | 96 #include "chrome/browser/ui/panels/panel_manager.h" |
| 98 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 97 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 99 #include "chrome/browser/ui/status_bubble.h" | 98 #include "chrome/browser/ui/status_bubble.h" |
| 100 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 99 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 101 #include "chrome/browser/ui/tabs/dock_info.h" | 100 #include "chrome/browser/ui/tabs/dock_info.h" |
| 102 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 101 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 103 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 102 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 104 #include "chrome/browser/ui/webui/bug_report_ui.h" | 103 #include "chrome/browser/ui/webui/bug_report_ui.h" |
| (...skipping 2393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 // static | 2497 // static |
| 2499 void Browser::WebIntentDispatchHelper(TabContents* tab, | 2498 void Browser::WebIntentDispatchHelper(TabContents* tab, |
| 2500 int routing_id, | 2499 int routing_id, |
| 2501 const string16& action, | 2500 const string16& action, |
| 2502 const string16& type, | 2501 const string16& type, |
| 2503 const string16& data, | 2502 const string16& data, |
| 2504 int intent_id) { | 2503 int intent_id) { |
| 2505 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 2504 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 2506 return; | 2505 return; |
| 2507 | 2506 |
| 2508 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | |
| 2509 tab); | |
| 2510 | |
| 2511 DLOG(INFO) << "Browser tab contents received intent:" | 2507 DLOG(INFO) << "Browser tab contents received intent:" |
| 2512 << "\naction=" << UTF16ToASCII(action) | 2508 << "\naction=" << UTF16ToASCII(action) |
| 2513 << "\ntype=" << UTF16ToASCII(type) | 2509 << "\ntype=" << UTF16ToASCII(type) |
| 2514 << "\nrenderer_id=" << routing_id | 2510 << "\nrenderer_id=" << routing_id |
| 2515 << "\nid=" << intent_id; | 2511 << "\nid=" << intent_id; |
| 2516 | |
| 2517 tcw->web_intent_picker_controller()->ShowDialog(action, type); | |
| 2518 } | 2512 } |
| 2519 | 2513 |
| 2520 void Browser::ExecuteCommandWithDisposition( | 2514 void Browser::ExecuteCommandWithDisposition( |
| 2521 int id, WindowOpenDisposition disposition) { | 2515 int id, WindowOpenDisposition disposition) { |
| 2522 // No commands are enabled if there is not yet any selected tab. | 2516 // No commands are enabled if there is not yet any selected tab. |
| 2523 // TODO(pkasting): It seems like we should not need this, because either | 2517 // TODO(pkasting): It seems like we should not need this, because either |
| 2524 // most/all commands should not have been enabled yet anyway or the ones that | 2518 // most/all commands should not have been enabled yet anyway or the ones that |
| 2525 // are enabled should be global, or safe themselves against having no selected | 2519 // are enabled should be global, or safe themselves against having no selected |
| 2526 // tab. However, Ben says he tried removing this before and got lots of | 2520 // tab. However, Ben says he tried removing this before and got lots of |
| 2527 // crashes, e.g. from Windows sending WM_COMMANDs at random times during | 2521 // crashes, e.g. from Windows sending WM_COMMANDs at random times during |
| (...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5126 } | 5120 } |
| 5127 | 5121 |
| 5128 void Browser::ShowSyncSetup() { | 5122 void Browser::ShowSyncSetup() { |
| 5129 ProfileSyncService* service = | 5123 ProfileSyncService* service = |
| 5130 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5124 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 5131 if (service->HasSyncSetupCompleted()) | 5125 if (service->HasSyncSetupCompleted()) |
| 5132 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5126 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 5133 else | 5127 else |
| 5134 service->ShowLoginDialog(); | 5128 service->ShowLoginDialog(); |
| 5135 } | 5129 } |
| OLD | NEW |