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 #ifndef CHROME_BROWSER_UI_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 | 877 |
878 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } | 878 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } |
879 bool is_type_popup() const { return type_ == TYPE_POPUP; } | 879 bool is_type_popup() const { return type_ == TYPE_POPUP; } |
880 bool is_type_panel() const { return type_ == TYPE_PANEL; } | 880 bool is_type_panel() const { return type_ == TYPE_PANEL; } |
881 | 881 |
882 bool is_app() const; | 882 bool is_app() const; |
883 bool is_devtools() const; | 883 bool is_devtools() const; |
884 | 884 |
885 // True when the current tab is in fullscreen mode, requested by | 885 // True when the current tab is in fullscreen mode, requested by |
886 // webkitRequestFullScreen. | 886 // webkitRequestFullScreen. |
887 bool IsFullscreenForTab() const; | 887 bool IsFullscreenForTabOrPending() const; |
| 888 |
| 889 // True when the mouse cursor is locked or pending lock. |
| 890 bool IsMouseLockedOrPending() const; |
888 | 891 |
889 // Called each time the browser window is shown. | 892 // Called each time the browser window is shown. |
890 void OnWindowDidShow(); | 893 void OnWindowDidShow(); |
891 | 894 |
892 // Show the first run search engine bubble on the location bar. | 895 // Show the first run search engine bubble on the location bar. |
893 void ShowFirstRunBubble(); | 896 void ShowFirstRunBubble(); |
894 | 897 |
895 ExtensionWindowController* extension_window_controller() const { | 898 ExtensionWindowController* extension_window_controller() const { |
896 return extension_window_controller_.get(); | 899 return extension_window_controller_.get(); |
897 } | 900 } |
898 | 901 |
899 protected: | 902 protected: |
900 // Wrapper for the factory method in BrowserWindow. This allows subclasses to | 903 // Wrapper for the factory method in BrowserWindow. This allows subclasses to |
901 // set their own window. | 904 // set their own window. |
902 virtual BrowserWindow* CreateBrowserWindow(); | 905 virtual BrowserWindow* CreateBrowserWindow(); |
903 | 906 |
904 private: | 907 private: |
| 908 friend class BrowserTest; |
905 FRIEND_TEST_ALL_PREFIXES(AppModeTest, EnableAppModeTest); | 909 FRIEND_TEST_ALL_PREFIXES(AppModeTest, EnableAppModeTest); |
906 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups); | 910 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups); |
907 FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut); | 911 FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut); |
908 FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp); | 912 FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp); |
909 FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch); | 913 FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch); |
910 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TestNewTabExitsFullscreen); | |
911 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TestTabExitsItselfFromFullscreen); | |
912 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TestFullscreenBubbleMouseLockState); | |
913 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TabEntersPresentationModeFromWindowed); | 914 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TabEntersPresentationModeFromWindowed); |
914 FRIEND_TEST_ALL_PREFIXES(FullscreenExitBubbleControllerTest, | 915 FRIEND_TEST_ALL_PREFIXES(FullscreenExitBubbleControllerTest, |
915 DenyExitsFullscreen); | 916 DenyExitsFullscreen); |
916 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutNoPref); | 917 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutNoPref); |
917 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutWindowPref); | 918 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutWindowPref); |
918 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutTabPref); | 919 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutTabPref); |
919 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutPanel); | 920 FRIEND_TEST_ALL_PREFIXES(BrowserInitTest, OpenAppShortcutPanel); |
920 | 921 |
921 // Used to describe why a tab is being detached. This is used by | 922 // Used to describe why a tab is being detached. This is used by |
922 // TabDetachedAtImpl. | 923 // TabDetachedAtImpl. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 virtual void DidNavigateToPendingEntry(content::WebContents* tab) OVERRIDE; | 1025 virtual void DidNavigateToPendingEntry(content::WebContents* tab) OVERRIDE; |
1025 virtual content::JavaScriptDialogCreator* | 1026 virtual content::JavaScriptDialogCreator* |
1026 GetJavaScriptDialogCreator() OVERRIDE; | 1027 GetJavaScriptDialogCreator() OVERRIDE; |
1027 virtual void RunFileChooser( | 1028 virtual void RunFileChooser( |
1028 content::WebContents* tab, | 1029 content::WebContents* tab, |
1029 const content::FileChooserParams& params) OVERRIDE; | 1030 const content::FileChooserParams& params) OVERRIDE; |
1030 virtual void EnumerateDirectory(content::WebContents* tab, int request_id, | 1031 virtual void EnumerateDirectory(content::WebContents* tab, int request_id, |
1031 const FilePath& path) OVERRIDE; | 1032 const FilePath& path) OVERRIDE; |
1032 virtual void ToggleFullscreenModeForTab(content::WebContents* tab, | 1033 virtual void ToggleFullscreenModeForTab(content::WebContents* tab, |
1033 bool enter_fullscreen) OVERRIDE; | 1034 bool enter_fullscreen) OVERRIDE; |
1034 virtual bool IsFullscreenForTab( | 1035 virtual bool IsFullscreenForTabOrPending( |
1035 const content::WebContents* tab) const OVERRIDE; | 1036 const content::WebContents* tab) const OVERRIDE; |
1036 virtual void JSOutOfMemory(content::WebContents* tab) OVERRIDE; | 1037 virtual void JSOutOfMemory(content::WebContents* tab) OVERRIDE; |
1037 virtual void RegisterProtocolHandler(content::WebContents* tab, | 1038 virtual void RegisterProtocolHandler(content::WebContents* tab, |
1038 const std::string& protocol, | 1039 const std::string& protocol, |
1039 const GURL& url, | 1040 const GURL& url, |
1040 const string16& title) OVERRIDE; | 1041 const string16& title) OVERRIDE; |
1041 virtual void RegisterIntentHandler(content::WebContents* tab, | 1042 virtual void RegisterIntentHandler(content::WebContents* tab, |
1042 const string16& action, | 1043 const string16& action, |
1043 const string16& type, | 1044 const string16& type, |
1044 const string16& href, | 1045 const string16& href, |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 | 1472 |
1472 scoped_ptr<ExtensionWindowController> extension_window_controller_; | 1473 scoped_ptr<ExtensionWindowController> extension_window_controller_; |
1473 | 1474 |
1474 // True if the browser window has been shown at least once. | 1475 // True if the browser window has been shown at least once. |
1475 bool window_has_shown_; | 1476 bool window_has_shown_; |
1476 | 1477 |
1477 DISALLOW_COPY_AND_ASSIGN(Browser); | 1478 DISALLOW_COPY_AND_ASSIGN(Browser); |
1478 }; | 1479 }; |
1479 | 1480 |
1480 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1481 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |