| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 #include "chrome/browser/ui/browser_list.h" | 97 #include "chrome/browser/ui/browser_list.h" |
| 98 #include "chrome/browser/ui/browser_navigator.h" | 98 #include "chrome/browser/ui/browser_navigator.h" |
| 99 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 99 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 100 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" | 100 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
| 101 #include "chrome/browser/ui/browser_tabstrip.h" | 101 #include "chrome/browser/ui/browser_tabstrip.h" |
| 102 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" | 102 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" |
| 103 #include "chrome/browser/ui/browser_ui_prefs.h" | 103 #include "chrome/browser/ui/browser_ui_prefs.h" |
| 104 #include "chrome/browser/ui/browser_window.h" | 104 #include "chrome/browser/ui/browser_window.h" |
| 105 #include "chrome/browser/ui/chrome_pages.h" | 105 #include "chrome/browser/ui/chrome_pages.h" |
| 106 #include "chrome/browser/ui/chrome_select_file_policy.h" | 106 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 107 #include "chrome/browser/ui/exclusive_access/exclusive_access_controller_manager
.h" |
| 107 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 108 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 109 #include "chrome/browser/ui/exclusive_access/mouse_lock_controller.h" |
| 108 #include "chrome/browser/ui/fast_unload_controller.h" | 110 #include "chrome/browser/ui/fast_unload_controller.h" |
| 109 #include "chrome/browser/ui/find_bar/find_bar.h" | 111 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 110 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 112 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 111 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 113 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 112 #include "chrome/browser/ui/global_error/global_error.h" | 114 #include "chrome/browser/ui/global_error/global_error.h" |
| 113 #include "chrome/browser/ui/global_error/global_error_service.h" | 115 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 114 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 116 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 115 #include "chrome/browser/ui/location_bar/location_bar.h" | 117 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 116 #include "chrome/browser/ui/media_utils.h" | 118 #include "chrome/browser/ui/media_utils.h" |
| 117 #include "chrome/browser/ui/search/search_delegate.h" | 119 #include "chrome/browser/ui/search/search_delegate.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 440 |
| 439 // TODO(beng): move to ChromeBrowserMain: | 441 // TODO(beng): move to ChromeBrowserMain: |
| 440 if (first_run::ShouldDoPersonalDataManagerFirstRun()) { | 442 if (first_run::ShouldDoPersonalDataManagerFirstRun()) { |
| 441 #if defined(OS_WIN) | 443 #if defined(OS_WIN) |
| 442 // Notify PDM that this is a first run. | 444 // Notify PDM that this is a first run. |
| 443 ImportAutofillDataWin( | 445 ImportAutofillDataWin( |
| 444 autofill::PersonalDataManagerFactory::GetForProfile(profile_)); | 446 autofill::PersonalDataManagerFactory::GetForProfile(profile_)); |
| 445 #endif // defined(OS_WIN) | 447 #endif // defined(OS_WIN) |
| 446 } | 448 } |
| 447 | 449 |
| 448 fullscreen_controller_.reset(new FullscreenController(this)); | 450 exclusive_access_controller_manager_.reset( |
| 451 new ExclusiveAccessControllerManager(this)); |
| 449 | 452 |
| 450 // Must be initialized after window_. | 453 // Must be initialized after window_. |
| 451 // Also: surprise! a modal dialog host is not necessary to host modal dialogs | 454 // Also: surprise! a modal dialog host is not necessary to host modal dialogs |
| 452 // without a modal dialog host, so that value may be null. | 455 // without a modal dialog host, so that value may be null. |
| 453 popup_manager_.reset(new web_modal::PopupManager( | 456 popup_manager_.reset(new web_modal::PopupManager( |
| 454 GetWebContentsModalDialogHost())); | 457 GetWebContentsModalDialogHost())); |
| 455 } | 458 } |
| 456 | 459 |
| 457 Browser::~Browser() { | 460 Browser::~Browser() { |
| 458 // Stop observing notifications before continuing with destruction. Profile | 461 // Stop observing notifications before continuing with destruction. Profile |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 } | 781 } |
| 779 | 782 |
| 780 // Those are the only conditions under which we will block shutdown. | 783 // Those are the only conditions under which we will block shutdown. |
| 781 return DOWNLOAD_CLOSE_OK; | 784 return DOWNLOAD_CLOSE_OK; |
| 782 } | 785 } |
| 783 | 786 |
| 784 //////////////////////////////////////////////////////////////////////////////// | 787 //////////////////////////////////////////////////////////////////////////////// |
| 785 // Browser, Tab adding/showing functions: | 788 // Browser, Tab adding/showing functions: |
| 786 | 789 |
| 787 void Browser::WindowFullscreenStateChanged() { | 790 void Browser::WindowFullscreenStateChanged() { |
| 788 fullscreen_controller_->WindowFullscreenStateChanged(); | 791 exclusive_access_controller_manager_->GetFullscreenController() |
| 792 ->WindowFullscreenStateChanged(); |
| 789 command_controller_->FullscreenStateChanged(); | 793 command_controller_->FullscreenStateChanged(); |
| 790 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); | 794 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); |
| 791 } | 795 } |
| 792 | 796 |
| 793 /////////////////////////////////////////////////////////////////////////////// | 797 /////////////////////////////////////////////////////////////////////////////// |
| 794 // Browser, Assorted browser commands: | 798 // Browser, Assorted browser commands: |
| 795 | 799 |
| 796 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { | 800 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { |
| 797 fullscreen_controller_-> | 801 exclusive_access_controller_manager_->GetFullscreenController() |
| 798 ToggleBrowserFullscreenModeWithExtension(extension_url); | 802 ->ToggleBrowserFullscreenModeWithExtension(extension_url); |
| 799 } | 803 } |
| 800 | 804 |
| 801 bool Browser::SupportsWindowFeature(WindowFeature feature) const { | 805 bool Browser::SupportsWindowFeature(WindowFeature feature) const { |
| 802 return SupportsWindowFeatureImpl(feature, true); | 806 return SupportsWindowFeatureImpl(feature, true); |
| 803 } | 807 } |
| 804 | 808 |
| 805 bool Browser::CanSupportWindowFeature(WindowFeature feature) const { | 809 bool Browser::CanSupportWindowFeature(WindowFeature feature) const { |
| 806 return SupportsWindowFeatureImpl(feature, false); | 810 return SupportsWindowFeatureImpl(feature, false); |
| 807 } | 811 } |
| 808 | 812 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 int new_active_index = tab_strip_model_->active_index(); | 942 int new_active_index = tab_strip_model_->active_index(); |
| 939 if (index < new_active_index) | 943 if (index < new_active_index) |
| 940 session_service->SetSelectedTabInWindow(session_id(), | 944 session_service->SetSelectedTabInWindow(session_id(), |
| 941 new_active_index); | 945 new_active_index); |
| 942 } | 946 } |
| 943 } | 947 } |
| 944 | 948 |
| 945 void Browser::TabClosingAt(TabStripModel* tab_strip_model, | 949 void Browser::TabClosingAt(TabStripModel* tab_strip_model, |
| 946 WebContents* contents, | 950 WebContents* contents, |
| 947 int index) { | 951 int index) { |
| 948 fullscreen_controller_->OnTabClosing(contents); | 952 exclusive_access_controller_manager_->OnTabClosing(contents); |
| 949 SessionService* session_service = | 953 SessionService* session_service = |
| 950 SessionServiceFactory::GetForProfile(profile_); | 954 SessionServiceFactory::GetForProfile(profile_); |
| 951 if (session_service) | 955 if (session_service) |
| 952 session_service->TabClosing(contents); | 956 session_service->TabClosing(contents); |
| 953 content::NotificationService::current()->Notify( | 957 content::NotificationService::current()->Notify( |
| 954 chrome::NOTIFICATION_TAB_CLOSING, | 958 chrome::NOTIFICATION_TAB_CLOSING, |
| 955 content::Source<NavigationController>(&contents->GetController()), | 959 content::Source<NavigationController>(&contents->GetController()), |
| 956 content::NotificationService::NoDetails()); | 960 content::NotificationService::NoDetails()); |
| 957 | 961 |
| 958 if (popup_manager_) | 962 if (popup_manager_) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 974 old_active_index - 1); | 978 old_active_index - 1); |
| 975 } | 979 } |
| 976 | 980 |
| 977 if (popup_manager_) | 981 if (popup_manager_) |
| 978 popup_manager_->UnregisterWith(contents); | 982 popup_manager_->UnregisterWith(contents); |
| 979 | 983 |
| 980 TabDetachedAtImpl(contents, index, DETACH_TYPE_DETACH); | 984 TabDetachedAtImpl(contents, index, DETACH_TYPE_DETACH); |
| 981 } | 985 } |
| 982 | 986 |
| 983 void Browser::TabDeactivated(WebContents* contents) { | 987 void Browser::TabDeactivated(WebContents* contents) { |
| 984 fullscreen_controller_->OnTabDeactivated(contents); | 988 exclusive_access_controller_manager_->OnTabDeactivated(contents); |
| 985 search_delegate_->OnTabDeactivated(contents); | 989 search_delegate_->OnTabDeactivated(contents); |
| 986 SearchTabHelper::FromWebContents(contents)->OnTabDeactivated(); | 990 SearchTabHelper::FromWebContents(contents)->OnTabDeactivated(); |
| 987 | 991 |
| 988 // Save what the user's currently typing, so it can be restored when we | 992 // Save what the user's currently typing, so it can be restored when we |
| 989 // switch back to this tab. | 993 // switch back to this tab. |
| 990 window_->GetLocationBar()->SaveStateToContents(contents); | 994 window_->GetLocationBar()->SaveStateToContents(contents); |
| 991 | 995 |
| 992 if (instant_controller_) | 996 if (instant_controller_) |
| 993 instant_controller_->TabDeactivated(contents); | 997 instant_controller_->TabDeactivated(contents); |
| 994 } | 998 } |
| 995 | 999 |
| 996 void Browser::ActiveTabChanged(WebContents* old_contents, | 1000 void Browser::ActiveTabChanged(WebContents* old_contents, |
| 997 WebContents* new_contents, | 1001 WebContents* new_contents, |
| 998 int index, | 1002 int index, |
| 999 int reason) { | 1003 int reason) { |
| 1000 content::RecordAction(UserMetricsAction("ActiveTabChanged")); | 1004 content::RecordAction(UserMetricsAction("ActiveTabChanged")); |
| 1001 | 1005 |
| 1002 // Update the bookmark state, since the BrowserWindow may query it during | 1006 // Update the bookmark state, since the BrowserWindow may query it during |
| 1003 // OnActiveTabChanged() below. | 1007 // OnActiveTabChanged() below. |
| 1004 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH); | 1008 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH); |
| 1005 | 1009 |
| 1006 // Let the BrowserWindow do its handling. On e.g. views this changes the | 1010 // Let the BrowserWindow do its handling. On e.g. views this changes the |
| 1007 // focused object, which should happen before we update the toolbar below, | 1011 // focused object, which should happen before we update the toolbar below, |
| 1008 // since the omnibox expects the correct element to already be focused when it | 1012 // since the omnibox expects the correct element to already be focused when it |
| 1009 // is updated. | 1013 // is updated. |
| 1010 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); | 1014 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); |
| 1011 | 1015 |
| 1012 fullscreen_controller_->OnTabDetachedFromView(old_contents); | 1016 exclusive_access_controller_manager_->OnTabDetachedFromView(old_contents); |
| 1013 | 1017 |
| 1014 // Discarded tabs always get reloaded. | 1018 // Discarded tabs always get reloaded. |
| 1015 if (tab_strip_model_->IsTabDiscarded(index)) { | 1019 if (tab_strip_model_->IsTabDiscarded(index)) { |
| 1016 LOG(WARNING) << "Reloading discarded tab at " << index; | 1020 LOG(WARNING) << "Reloading discarded tab at " << index; |
| 1017 static int reload_count = 0; | 1021 static int reload_count = 0; |
| 1018 UMA_HISTOGRAM_CUSTOM_COUNTS( | 1022 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 1019 "Tabs.Discard.ReloadCount", ++reload_count, 1, 1000, 50); | 1023 "Tabs.Discard.ReloadCount", ++reload_count, 1, 1000, 50); |
| 1020 chrome::Reload(this, CURRENT_TAB); | 1024 chrome::Reload(this, CURRENT_TAB); |
| 1021 } | 1025 } |
| 1022 | 1026 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 DCHECK(from_index >= 0 && to_index >= 0); | 1078 DCHECK(from_index >= 0 && to_index >= 0); |
| 1075 // Notify the history service. | 1079 // Notify the history service. |
| 1076 SyncHistoryWithTabs(std::min(from_index, to_index)); | 1080 SyncHistoryWithTabs(std::min(from_index, to_index)); |
| 1077 } | 1081 } |
| 1078 | 1082 |
| 1079 void Browser::TabReplacedAt(TabStripModel* tab_strip_model, | 1083 void Browser::TabReplacedAt(TabStripModel* tab_strip_model, |
| 1080 WebContents* old_contents, | 1084 WebContents* old_contents, |
| 1081 WebContents* new_contents, | 1085 WebContents* new_contents, |
| 1082 int index) { | 1086 int index) { |
| 1083 TabDetachedAtImpl(old_contents, index, DETACH_TYPE_REPLACE); | 1087 TabDetachedAtImpl(old_contents, index, DETACH_TYPE_REPLACE); |
| 1084 fullscreen_controller_->OnTabClosing(old_contents); | 1088 exclusive_access_controller_manager_->OnTabClosing(old_contents); |
| 1085 SessionService* session_service = | 1089 SessionService* session_service = |
| 1086 SessionServiceFactory::GetForProfile(profile_); | 1090 SessionServiceFactory::GetForProfile(profile_); |
| 1087 if (session_service) | 1091 if (session_service) |
| 1088 session_service->TabClosing(old_contents); | 1092 session_service->TabClosing(old_contents); |
| 1089 TabInsertedAt(new_contents, | 1093 TabInsertedAt(new_contents, |
| 1090 index, | 1094 index, |
| 1091 (index == tab_strip_model_->active_index())); | 1095 (index == tab_strip_model_->active_index())); |
| 1092 | 1096 |
| 1093 int entry_count = new_contents->GetController().GetEntryCount(); | 1097 int entry_count = new_contents->GetController().GetEntryCount(); |
| 1094 if (entry_count > 0) { | 1098 if (entry_count > 0) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 GURL committed_url(source->GetController().GetLastCommittedEntry()->GetURL()); | 1181 GURL committed_url(source->GetController().GetLastCommittedEntry()->GetURL()); |
| 1178 return chrome::IsNTPURL(committed_url, profile); | 1182 return chrome::IsNTPURL(committed_url, profile); |
| 1179 } | 1183 } |
| 1180 | 1184 |
| 1181 bool Browser::PreHandleKeyboardEvent(content::WebContents* source, | 1185 bool Browser::PreHandleKeyboardEvent(content::WebContents* source, |
| 1182 const NativeWebKeyboardEvent& event, | 1186 const NativeWebKeyboardEvent& event, |
| 1183 bool* is_keyboard_shortcut) { | 1187 bool* is_keyboard_shortcut) { |
| 1184 // Escape exits tabbed fullscreen mode. | 1188 // Escape exits tabbed fullscreen mode. |
| 1185 // TODO(koz): Write a test for this http://crbug.com/100441. | 1189 // TODO(koz): Write a test for this http://crbug.com/100441. |
| 1186 if (event.windowsKeyCode == 27 && | 1190 if (event.windowsKeyCode == 27 && |
| 1187 fullscreen_controller_->HandleUserPressedEscape()) { | 1191 exclusive_access_controller_manager_->HandleUserPressedEscape()) { |
| 1188 return true; | 1192 return true; |
| 1189 } | 1193 } |
| 1190 return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut); | 1194 return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut); |
| 1191 } | 1195 } |
| 1192 | 1196 |
| 1193 void Browser::HandleKeyboardEvent(content::WebContents* source, | 1197 void Browser::HandleKeyboardEvent(content::WebContents* source, |
| 1194 const NativeWebKeyboardEvent& event) { | 1198 const NativeWebKeyboardEvent& event) { |
| 1195 DevToolsWindow* devtools_window = | 1199 DevToolsWindow* devtools_window = |
| 1196 DevToolsWindow::GetInstanceForInspectedWebContents(source); | 1200 DevToolsWindow::GetInstanceForInspectedWebContents(source); |
| 1197 bool handled = false; | 1201 bool handled = false; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 // Disallow drag-and-drop navigation for Settings windows which do not support | 1259 // Disallow drag-and-drop navigation for Settings windows which do not support |
| 1256 // external navigation. | 1260 // external navigation. |
| 1257 if ((operations_allowed & blink::WebDragOperationLink) && | 1261 if ((operations_allowed & blink::WebDragOperationLink) && |
| 1258 chrome::SettingsWindowManager::GetInstance()->IsSettingsBrowser(this)) { | 1262 chrome::SettingsWindowManager::GetInstance()->IsSettingsBrowser(this)) { |
| 1259 return false; | 1263 return false; |
| 1260 } | 1264 } |
| 1261 return true; | 1265 return true; |
| 1262 } | 1266 } |
| 1263 | 1267 |
| 1264 bool Browser::IsMouseLocked() const { | 1268 bool Browser::IsMouseLocked() const { |
| 1265 return fullscreen_controller_->IsMouseLocked(); | 1269 return exclusive_access_controller_manager_->GetMouseLockController() |
| 1270 ->IsMouseLocked(); |
| 1266 } | 1271 } |
| 1267 | 1272 |
| 1268 void Browser::OnWindowDidShow() { | 1273 void Browser::OnWindowDidShow() { |
| 1269 if (window_has_shown_) | 1274 if (window_has_shown_) |
| 1270 return; | 1275 return; |
| 1271 window_has_shown_ = true; | 1276 window_has_shown_ = true; |
| 1272 | 1277 |
| 1273 // CurrentProcessInfo::CreationTime() is missing on some platforms. | 1278 // CurrentProcessInfo::CreationTime() is missing on some platforms. |
| 1274 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) | 1279 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) |
| 1275 // Measure the latency from startup till the first browser window becomes | 1280 // Measure the latency from startup till the first browser window becomes |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 const base::FilePath& path) { | 1664 const base::FilePath& path) { |
| 1660 FileSelectHelper::EnumerateDirectory(web_contents, request_id, path); | 1665 FileSelectHelper::EnumerateDirectory(web_contents, request_id, path); |
| 1661 } | 1666 } |
| 1662 | 1667 |
| 1663 bool Browser::EmbedsFullscreenWidget() const { | 1668 bool Browser::EmbedsFullscreenWidget() const { |
| 1664 return true; | 1669 return true; |
| 1665 } | 1670 } |
| 1666 | 1671 |
| 1667 void Browser::ToggleFullscreenModeForTab(WebContents* web_contents, | 1672 void Browser::ToggleFullscreenModeForTab(WebContents* web_contents, |
| 1668 bool enter_fullscreen) { | 1673 bool enter_fullscreen) { |
| 1669 fullscreen_controller_->ToggleFullscreenModeForTab(web_contents, | 1674 exclusive_access_controller_manager_->GetFullscreenController() |
| 1670 enter_fullscreen); | 1675 ->ToggleFullscreenModeForTab(web_contents, enter_fullscreen); |
| 1671 } | 1676 } |
| 1672 | 1677 |
| 1673 bool Browser::IsFullscreenForTabOrPending( | 1678 bool Browser::IsFullscreenForTabOrPending( |
| 1674 const WebContents* web_contents) const { | 1679 const WebContents* web_contents) const { |
| 1675 return fullscreen_controller_->IsFullscreenForTabOrPending(web_contents); | 1680 return exclusive_access_controller_manager_->GetFullscreenController() |
| 1681 ->IsFullscreenForTabOrPending(web_contents); |
| 1676 } | 1682 } |
| 1677 | 1683 |
| 1678 void Browser::RegisterProtocolHandler(WebContents* web_contents, | 1684 void Browser::RegisterProtocolHandler(WebContents* web_contents, |
| 1679 const std::string& protocol, | 1685 const std::string& protocol, |
| 1680 const GURL& url, | 1686 const GURL& url, |
| 1681 bool user_gesture) { | 1687 bool user_gesture) { |
| 1682 content::BrowserContext* context = web_contents->GetBrowserContext(); | 1688 content::BrowserContext* context = web_contents->GetBrowserContext(); |
| 1683 if (context->IsOffTheRecord()) | 1689 if (context->IsOffTheRecord()) |
| 1684 return; | 1690 return; |
| 1685 | 1691 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 find_tab_helper->HandleFindReply(request_id, | 1767 find_tab_helper->HandleFindReply(request_id, |
| 1762 number_of_matches, | 1768 number_of_matches, |
| 1763 selection_rect, | 1769 selection_rect, |
| 1764 active_match_ordinal, | 1770 active_match_ordinal, |
| 1765 final_update); | 1771 final_update); |
| 1766 } | 1772 } |
| 1767 | 1773 |
| 1768 void Browser::RequestToLockMouse(WebContents* web_contents, | 1774 void Browser::RequestToLockMouse(WebContents* web_contents, |
| 1769 bool user_gesture, | 1775 bool user_gesture, |
| 1770 bool last_unlocked_by_target) { | 1776 bool last_unlocked_by_target) { |
| 1771 fullscreen_controller_->RequestToLockMouse(web_contents, | 1777 exclusive_access_controller_manager_->GetMouseLockController() |
| 1772 user_gesture, | 1778 ->RequestToLockMouse(web_contents, user_gesture, last_unlocked_by_target); |
| 1773 last_unlocked_by_target); | |
| 1774 } | 1779 } |
| 1775 | 1780 |
| 1776 void Browser::LostMouseLock() { | 1781 void Browser::LostMouseLock() { |
| 1777 fullscreen_controller_->LostMouseLock(); | 1782 exclusive_access_controller_manager_->GetMouseLockController() |
| 1783 ->LostMouseLock(); |
| 1778 } | 1784 } |
| 1779 | 1785 |
| 1780 void Browser::RequestMediaAccessPermission( | 1786 void Browser::RequestMediaAccessPermission( |
| 1781 content::WebContents* web_contents, | 1787 content::WebContents* web_contents, |
| 1782 const content::MediaStreamRequest& request, | 1788 const content::MediaStreamRequest& request, |
| 1783 const content::MediaResponseCallback& callback) { | 1789 const content::MediaResponseCallback& callback) { |
| 1784 ::RequestMediaAccessPermission(web_contents, profile_, request, callback); | 1790 ::RequestMediaAccessPermission(web_contents, profile_, request, callback); |
| 1785 } | 1791 } |
| 1786 | 1792 |
| 1787 bool Browser::CheckMediaAccessPermission(content::WebContents* web_contents, | 1793 bool Browser::CheckMediaAccessPermission(content::WebContents* web_contents, |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2510 if (contents && !allow_js_access) { | 2516 if (contents && !allow_js_access) { |
| 2511 contents->web_contents()->GetController().LoadURL( | 2517 contents->web_contents()->GetController().LoadURL( |
| 2512 target_url, | 2518 target_url, |
| 2513 content::Referrer(), | 2519 content::Referrer(), |
| 2514 ui::PAGE_TRANSITION_LINK, | 2520 ui::PAGE_TRANSITION_LINK, |
| 2515 std::string()); // No extra headers. | 2521 std::string()); // No extra headers. |
| 2516 } | 2522 } |
| 2517 | 2523 |
| 2518 return contents != NULL; | 2524 return contents != NULL; |
| 2519 } | 2525 } |
| OLD | NEW |