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 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2511 | 2511 |
2512 DLOG(INFO) << "Browser tab contents received intent:" | 2512 DLOG(INFO) << "Browser tab contents received intent:" |
2513 << "\naction=" << UTF16ToASCII(action) | 2513 << "\naction=" << UTF16ToASCII(action) |
2514 << "\ntype=" << UTF16ToASCII(type) | 2514 << "\ntype=" << UTF16ToASCII(type) |
2515 << "\nrenderer_id=" << routing_id | 2515 << "\nrenderer_id=" << routing_id |
2516 << "\nid=" << intent_id; | 2516 << "\nid=" << intent_id; |
2517 | 2517 |
2518 tcw->web_intent_picker_controller()->ShowDialog(action, type); | 2518 tcw->web_intent_picker_controller()->ShowDialog(action, type); |
2519 } | 2519 } |
2520 | 2520 |
2521 // static | |
2522 void Browser::FindReplyHelper(TabContents* tab, | |
2523 int request_id, | |
2524 int number_of_matches, | |
2525 const gfx::Rect& selection_rect, | |
2526 int active_match_ordinal, | |
2527 bool final_update) { | |
2528 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | |
2529 tab); | |
2530 if (!tcw || !tcw->find_tab_helper()) | |
2531 return; | |
2532 | |
2533 tcw->find_tab_helper()->HandleFindReply(request_id, number_of_matches, | |
2534 selection_rect, active_match_ordinal, | |
2535 final_update); | |
2536 } | |
2537 | |
2521 void Browser::ExecuteCommandWithDisposition( | 2538 void Browser::ExecuteCommandWithDisposition( |
2522 int id, WindowOpenDisposition disposition) { | 2539 int id, WindowOpenDisposition disposition) { |
2523 // No commands are enabled if there is not yet any selected tab. | 2540 // No commands are enabled if there is not yet any selected tab. |
2524 // TODO(pkasting): It seems like we should not need this, because either | 2541 // TODO(pkasting): It seems like we should not need this, because either |
2525 // most/all commands should not have been enabled yet anyway or the ones that | 2542 // most/all commands should not have been enabled yet anyway or the ones that |
2526 // are enabled should be global, or safe themselves against having no selected | 2543 // are enabled should be global, or safe themselves against having no selected |
2527 // tab. However, Ben says he tried removing this before and got lots of | 2544 // tab. However, Ben says he tried removing this before and got lots of |
2528 // crashes, e.g. from Windows sending WM_COMMANDs at random times during | 2545 // crashes, e.g. from Windows sending WM_COMMANDs at random times during |
2529 // window construction. This probably could use closer examination someday. | 2546 // window construction. This probably could use closer examination someday. |
2530 if (!GetSelectedTabContentsWrapper()) | 2547 if (!GetSelectedTabContentsWrapper()) |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3766 void Browser::WebIntentDispatch(TabContents* tab, | 3783 void Browser::WebIntentDispatch(TabContents* tab, |
3767 int routing_id, | 3784 int routing_id, |
3768 const string16& action, | 3785 const string16& action, |
3769 const string16& type, | 3786 const string16& type, |
3770 const string16& data, | 3787 const string16& data, |
3771 int intent_id) { | 3788 int intent_id) { |
3772 Browser::WebIntentDispatchHelper(tab, routing_id, action, type, data, | 3789 Browser::WebIntentDispatchHelper(tab, routing_id, action, type, data, |
3773 intent_id); | 3790 intent_id); |
3774 } | 3791 } |
3775 | 3792 |
3793 void Browser::FindReply(TabContents* tab, | |
3794 int request_id, | |
3795 int number_of_matches, | |
3796 const gfx::Rect& selection_rect, | |
3797 int active_match_ordinal, | |
3798 bool final_update) { | |
3799 Browser::FindReplyHelper(tab, request_id, number_of_matches, selection_rect, | |
jam
2011/09/02 00:05:26
nit: the Browser:: is redundant
ananta
2011/09/02 00:28:28
Done. I also removed the Browser prefix from other
| |
3800 active_match_ordinal, final_update); | |
3801 } | |
3802 | |
3776 void Browser::ExitTabbedFullscreenModeIfNecessary() { | 3803 void Browser::ExitTabbedFullscreenModeIfNecessary() { |
3777 if (tab_caused_fullscreen_) | 3804 if (tab_caused_fullscreen_) |
3778 ToggleFullscreenMode(); | 3805 ToggleFullscreenMode(); |
3779 else | 3806 else |
3780 NotifyTabOfFullscreenExitIfNecessary(); | 3807 NotifyTabOfFullscreenExitIfNecessary(); |
3781 } | 3808 } |
3782 | 3809 |
3783 /////////////////////////////////////////////////////////////////////////////// | 3810 /////////////////////////////////////////////////////////////////////////////// |
3784 // Browser, TabContentsWrapperDelegate implementation: | 3811 // Browser, TabContentsWrapperDelegate implementation: |
3785 | 3812 |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5127 } | 5154 } |
5128 | 5155 |
5129 void Browser::ShowSyncSetup() { | 5156 void Browser::ShowSyncSetup() { |
5130 ProfileSyncService* service = | 5157 ProfileSyncService* service = |
5131 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5158 profile()->GetOriginalProfile()->GetProfileSyncService(); |
5132 if (service->HasSyncSetupCompleted()) | 5159 if (service->HasSyncSetupCompleted()) |
5133 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5160 ShowOptionsTab(chrome::kSyncSetupSubPage); |
5134 else | 5161 else |
5135 service->ShowLoginDialog(); | 5162 service->ShowLoginDialog(); |
5136 } | 5163 } |
OLD | NEW |