Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 741 void Browser::WindowFullscreenStateChanged() { | 741 void Browser::WindowFullscreenStateChanged() { |
| 742 fullscreen_controller_->WindowFullscreenStateChanged(); | 742 fullscreen_controller_->WindowFullscreenStateChanged(); |
| 743 command_controller_->FullscreenStateChanged(); | 743 command_controller_->FullscreenStateChanged(); |
| 744 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); | 744 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); |
| 745 } | 745 } |
| 746 | 746 |
| 747 /////////////////////////////////////////////////////////////////////////////// | 747 /////////////////////////////////////////////////////////////////////////////// |
| 748 // Browser, Assorted browser commands: | 748 // Browser, Assorted browser commands: |
| 749 | 749 |
| 750 void Browser::ToggleFullscreenMode() { | 750 void Browser::ToggleFullscreenMode() { |
| 751 fullscreen_controller_->ToggleFullscreenMode(); | 751 fullscreen_controller_->ToggleFullscreenMode(); |
|
scheib
2012/07/03 17:08:49
Might as well remove all wrappers around fullscree
tfarina
2012/07/03 18:51:22
Done.
| |
| 752 } | 752 } |
| 753 | 753 |
| 754 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { | 754 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { |
| 755 fullscreen_controller_->ToggleFullscreenModeWithExtension(extension_url); | 755 fullscreen_controller_->ToggleFullscreenModeWithExtension(extension_url); |
| 756 } | 756 } |
| 757 | 757 |
| 758 #if defined(OS_MACOSX) | 758 #if defined(OS_MACOSX) |
| 759 void Browser::TogglePresentationMode() { | 759 void Browser::TogglePresentationMode() { |
| 760 fullscreen_controller_->TogglePresentationMode(); | 760 fullscreen_controller_->TogglePresentationMode(); |
| 761 } | 761 } |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1390 fullscreen_controller_->HandleUserPressedEscape()) { | 1390 fullscreen_controller_->HandleUserPressedEscape()) { |
| 1391 return true; | 1391 return true; |
| 1392 } | 1392 } |
| 1393 return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut); | 1393 return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut); |
| 1394 } | 1394 } |
| 1395 | 1395 |
| 1396 void Browser::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 1396 void Browser::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 1397 window()->HandleKeyboardEvent(event); | 1397 window()->HandleKeyboardEvent(event); |
| 1398 } | 1398 } |
| 1399 | 1399 |
| 1400 void Browser::OnAcceptFullscreenPermission( | |
| 1401 const GURL& url, | |
| 1402 FullscreenExitBubbleType bubble_type) { | |
| 1403 fullscreen_controller_->OnAcceptFullscreenPermission(url, bubble_type); | |
| 1404 } | |
| 1405 | |
| 1406 void Browser::OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type) { | |
| 1407 fullscreen_controller_->OnDenyFullscreenPermission(bubble_type); | |
| 1408 } | |
| 1409 | |
| 1410 bool Browser::TabsNeedBeforeUnloadFired() { | 1400 bool Browser::TabsNeedBeforeUnloadFired() { |
| 1411 if (tabs_needing_before_unload_fired_.empty()) { | 1401 if (tabs_needing_before_unload_fired_.empty()) { |
| 1412 for (int i = 0; i < tab_count(); ++i) { | 1402 for (int i = 0; i < tab_count(); ++i) { |
| 1413 WebContents* contents = chrome::GetTabContentsAt(this, i)->web_contents(); | 1403 WebContents* contents = chrome::GetTabContentsAt(this, i)->web_contents(); |
| 1414 if (contents->NeedToFireBeforeUnload()) | 1404 if (contents->NeedToFireBeforeUnload()) |
| 1415 tabs_needing_before_unload_fired_.insert(contents); | 1405 tabs_needing_before_unload_fired_.insert(contents); |
| 1416 } | 1406 } |
| 1417 } | 1407 } |
| 1418 return !tabs_needing_before_unload_fired_.empty(); | 1408 return !tabs_needing_before_unload_fired_.empty(); |
| 1419 } | 1409 } |
| 1420 | 1410 |
| 1421 bool Browser::IsFullscreenForTabOrPending() const { | 1411 bool Browser::IsFullscreenForTabOrPending() const { |
| 1422 return fullscreen_controller_->IsFullscreenForTabOrPending(); | 1412 return fullscreen_controller_->IsFullscreenForTabOrPending(); |
|
scheib
2012/07/03 17:08:49
Might as well remove all wrappers around fullscree
tfarina
2012/07/03 18:51:22
Done.
| |
| 1423 } | 1413 } |
| 1424 | 1414 |
| 1425 bool Browser::IsMouseLocked() const { | 1415 bool Browser::IsMouseLocked() const { |
| 1426 return fullscreen_controller_->IsMouseLocked(); | 1416 return fullscreen_controller_->IsMouseLocked(); |
| 1427 } | 1417 } |
| 1428 | 1418 |
| 1429 void Browser::OnWindowDidShow() { | 1419 void Browser::OnWindowDidShow() { |
| 1430 if (window_has_shown_) | 1420 if (window_has_shown_) |
| 1431 return; | 1421 return; |
| 1432 window_has_shown_ = true; | 1422 window_has_shown_ = true; |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1860 } | 1850 } |
| 1861 | 1851 |
| 1862 void Browser::EnumerateDirectory(WebContents* web_contents, | 1852 void Browser::EnumerateDirectory(WebContents* web_contents, |
| 1863 int request_id, | 1853 int request_id, |
| 1864 const FilePath& path) { | 1854 const FilePath& path) { |
| 1865 FileSelectHelper::EnumerateDirectory(web_contents, request_id, path); | 1855 FileSelectHelper::EnumerateDirectory(web_contents, request_id, path); |
| 1866 } | 1856 } |
| 1867 | 1857 |
| 1868 void Browser::ToggleFullscreenModeForTab(WebContents* web_contents, | 1858 void Browser::ToggleFullscreenModeForTab(WebContents* web_contents, |
| 1869 bool enter_fullscreen) { | 1859 bool enter_fullscreen) { |
| 1870 fullscreen_controller_->ToggleFullscreenModeForTab(web_contents, | 1860 fullscreen_controller_->ToggleFullscreenModeForTab(web_contents, |
|
scheib
2012/07/03 17:08:49
Might as well remove all wrappers around fullscree
tfarina
2012/07/03 18:51:22
This is a virtual function from WebContentsDelegat
| |
| 1871 enter_fullscreen); | 1861 enter_fullscreen); |
| 1872 } | 1862 } |
| 1873 | 1863 |
| 1874 bool Browser::IsFullscreenForTabOrPending( | 1864 bool Browser::IsFullscreenForTabOrPending( |
| 1875 const WebContents* web_contents) const { | 1865 const WebContents* web_contents) const { |
| 1876 return fullscreen_controller_->IsFullscreenForTabOrPending(web_contents); | 1866 return fullscreen_controller_->IsFullscreenForTabOrPending(web_contents); |
| 1877 } | 1867 } |
| 1878 | 1868 |
| 1879 void Browser::JSOutOfMemory(WebContents* web_contents) { | 1869 void Browser::JSOutOfMemory(WebContents* web_contents) { |
| 1880 JSOutOfMemoryHelper(web_contents); | 1870 JSOutOfMemoryHelper(web_contents); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1933 const gfx::Rect& selection_rect, | 1923 const gfx::Rect& selection_rect, |
| 1934 int active_match_ordinal, | 1924 int active_match_ordinal, |
| 1935 bool final_update) { | 1925 bool final_update) { |
| 1936 FindReplyHelper(web_contents, request_id, number_of_matches, selection_rect, | 1926 FindReplyHelper(web_contents, request_id, number_of_matches, selection_rect, |
| 1937 active_match_ordinal, final_update); | 1927 active_match_ordinal, final_update); |
| 1938 } | 1928 } |
| 1939 | 1929 |
| 1940 void Browser::RequestToLockMouse(WebContents* web_contents, | 1930 void Browser::RequestToLockMouse(WebContents* web_contents, |
| 1941 bool user_gesture, | 1931 bool user_gesture, |
| 1942 bool last_unlocked_by_target) { | 1932 bool last_unlocked_by_target) { |
| 1943 fullscreen_controller_->RequestToLockMouse(web_contents, | 1933 fullscreen_controller_->RequestToLockMouse(web_contents, |
|
scheib
2012/07/03 17:08:49
Might as well remove all wrappers around fullscree
tfarina
2012/07/03 18:51:22
This is a virtual function from WebContentsDelegat
| |
| 1944 user_gesture, | 1934 user_gesture, |
| 1945 last_unlocked_by_target); | 1935 last_unlocked_by_target); |
| 1946 } | 1936 } |
| 1947 | 1937 |
| 1948 void Browser::LostMouseLock() { | 1938 void Browser::LostMouseLock() { |
| 1949 fullscreen_controller_->LostMouseLock(); | 1939 fullscreen_controller_->LostMouseLock(); |
| 1950 } | 1940 } |
| 1951 | 1941 |
| 1952 void Browser::RequestMediaAccessPermission( | 1942 void Browser::RequestMediaAccessPermission( |
| 1953 content::WebContents* web_contents, | 1943 content::WebContents* web_contents, |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2816 if (contents && !allow_js_access) { | 2806 if (contents && !allow_js_access) { |
| 2817 contents->web_contents()->GetController().LoadURL( | 2807 contents->web_contents()->GetController().LoadURL( |
| 2818 target_url, | 2808 target_url, |
| 2819 content::Referrer(), | 2809 content::Referrer(), |
| 2820 content::PAGE_TRANSITION_LINK, | 2810 content::PAGE_TRANSITION_LINK, |
| 2821 std::string()); // No extra headers. | 2811 std::string()); // No extra headers. |
| 2822 } | 2812 } |
| 2823 | 2813 |
| 2824 return contents != NULL; | 2814 return contents != NULL; |
| 2825 } | 2815 } |
| OLD | NEW |