OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #include "chrome/browser/sync/profile_sync_service.h" | 78 #include "chrome/browser/sync/profile_sync_service.h" |
79 #include "chrome/browser/sync/profile_sync_service_factory.h" | 79 #include "chrome/browser/sync/profile_sync_service_factory.h" |
80 #include "chrome/browser/sync/sync_ui_util.h" | 80 #include "chrome/browser/sync/sync_ui_util.h" |
81 #include "chrome/browser/tab_contents/background_contents.h" | 81 #include "chrome/browser/tab_contents/background_contents.h" |
82 #include "chrome/browser/tab_contents/retargeting_details.h" | 82 #include "chrome/browser/tab_contents/retargeting_details.h" |
83 #include "chrome/browser/tab_contents/tab_util.h" | 83 #include "chrome/browser/tab_contents/tab_util.h" |
84 #include "chrome/browser/themes/theme_service.h" | 84 #include "chrome/browser/themes/theme_service.h" |
85 #include "chrome/browser/themes/theme_service_factory.h" | 85 #include "chrome/browser/themes/theme_service_factory.h" |
86 #include "chrome/browser/translate/chrome_translate_client.h" | 86 #include "chrome/browser/translate/chrome_translate_client.h" |
87 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" | 87 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
88 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 88 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
89 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 89 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
90 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 90 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
91 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 91 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
92 #include "chrome/browser/ui/browser_command_controller.h" | 92 #include "chrome/browser/ui/browser_command_controller.h" |
93 #include "chrome/browser/ui/browser_commands.h" | 93 #include "chrome/browser/ui/browser_commands.h" |
94 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 94 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
95 #include "chrome/browser/ui/browser_content_translate_driver_observer.h" | 95 #include "chrome/browser/ui/browser_content_translate_driver_observer.h" |
96 #include "chrome/browser/ui/browser_dialogs.h" | 96 #include "chrome/browser/ui/browser_dialogs.h" |
97 #include "chrome/browser/ui/browser_finder.h" | 97 #include "chrome/browser/ui/browser_finder.h" |
98 #include "chrome/browser/ui/browser_instant_controller.h" | 98 #include "chrome/browser/ui/browser_instant_controller.h" |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 SessionServiceFactory::GetForProfileIfExisting(profile_); | 1027 SessionServiceFactory::GetForProfileIfExisting(profile_); |
1028 if (session_service && !tab_strip_model_->closing_all()) { | 1028 if (session_service && !tab_strip_model_->closing_all()) { |
1029 session_service->SetSelectedTabInWindow(session_id(), | 1029 session_service->SetSelectedTabInWindow(session_id(), |
1030 tab_strip_model_->active_index()); | 1030 tab_strip_model_->active_index()); |
1031 } | 1031 } |
1032 | 1032 |
1033 // This needs to be called after notifying SearchDelegate. | 1033 // This needs to be called after notifying SearchDelegate. |
1034 if (instant_controller_) | 1034 if (instant_controller_) |
1035 instant_controller_->ActiveTabChanged(); | 1035 instant_controller_->ActiveTabChanged(); |
1036 | 1036 |
1037 autofill::TabAutofillManagerDelegate::FromWebContents(new_contents)-> | 1037 autofill::ChromeAutofillClient::FromWebContents(new_contents)->TabActivated(); |
1038 TabActivated(); | |
1039 SearchTabHelper::FromWebContents(new_contents)->OnTabActivated(); | 1038 SearchTabHelper::FromWebContents(new_contents)->OnTabActivated(); |
1040 } | 1039 } |
1041 | 1040 |
1042 void Browser::TabMoved(WebContents* contents, | 1041 void Browser::TabMoved(WebContents* contents, |
1043 int from_index, | 1042 int from_index, |
1044 int to_index) { | 1043 int to_index) { |
1045 DCHECK(from_index >= 0 && to_index >= 0); | 1044 DCHECK(from_index >= 0 && to_index >= 0); |
1046 // Notify the history service. | 1045 // Notify the history service. |
1047 SyncHistoryWithTabs(std::min(from_index, to_index)); | 1046 SyncHistoryWithTabs(std::min(from_index, to_index)); |
1048 } | 1047 } |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2419 if (contents && !allow_js_access) { | 2418 if (contents && !allow_js_access) { |
2420 contents->web_contents()->GetController().LoadURL( | 2419 contents->web_contents()->GetController().LoadURL( |
2421 target_url, | 2420 target_url, |
2422 content::Referrer(), | 2421 content::Referrer(), |
2423 content::PAGE_TRANSITION_LINK, | 2422 content::PAGE_TRANSITION_LINK, |
2424 std::string()); // No extra headers. | 2423 std::string()); // No extra headers. |
2425 } | 2424 } |
2426 | 2425 |
2427 return contents != NULL; | 2426 return contents != NULL; |
2428 } | 2427 } |
OLD | NEW |