| 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 // Called each time the browser window is shown. | 851 // Called each time the browser window is shown. |
| 852 void OnWindowDidShow(); | 852 void OnWindowDidShow(); |
| 853 | 853 |
| 854 // Show the first run search engine bubble on the location bar. | 854 // Show the first run search engine bubble on the location bar. |
| 855 void ShowFirstRunBubble(); | 855 void ShowFirstRunBubble(); |
| 856 | 856 |
| 857 ExtensionWindowController* extension_window_controller() const { | 857 ExtensionWindowController* extension_window_controller() const { |
| 858 return extension_window_controller_.get(); | 858 return extension_window_controller_.get(); |
| 859 } | 859 } |
| 860 | 860 |
| 861 protected: | |
| 862 // Wrapper for the factory method in BrowserWindow. This allows subclasses to | |
| 863 // set their own window. | |
| 864 virtual BrowserWindow* CreateBrowserWindow(); | |
| 865 | |
| 866 private: | |
| 867 friend class BrowserTest; | |
| 868 FRIEND_TEST_ALL_PREFIXES(AppModeTest, EnableAppModeTest); | |
| 869 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups); | |
| 870 FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut); | |
| 871 FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp); | |
| 872 FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch); | |
| 873 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TabEntersPresentationModeFromWindowed); | |
| 874 FRIEND_TEST_ALL_PREFIXES(FullscreenExitBubbleControllerTest, | |
| 875 DenyExitsFullscreen); | |
| 876 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutNoPref); | |
| 877 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | |
| 878 OpenAppShortcutWindowPref); | |
| 879 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutTabPref); | |
| 880 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutPanel); | |
| 881 | |
| 882 // Used to describe why a tab is being detached. This is used by | |
| 883 // TabDetachedAtImpl. | |
| 884 enum DetachType { | |
| 885 // Result of TabDetachedAt. | |
| 886 DETACH_TYPE_DETACH, | |
| 887 | |
| 888 // Result of TabReplacedAt. | |
| 889 DETACH_TYPE_REPLACE, | |
| 890 | |
| 891 // Result of the tab strip not having any significant tabs. | |
| 892 DETACH_TYPE_EMPTY | |
| 893 }; | |
| 894 | |
| 895 // Describes where the bookmark bar state change originated from. | |
| 896 enum BookmarkBarStateChangeReason { | |
| 897 // From the constructor. | |
| 898 BOOKMARK_BAR_STATE_CHANGE_INIT, | |
| 899 | |
| 900 // Change is the result of the active tab changing. | |
| 901 BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH, | |
| 902 | |
| 903 // Change is the result of the bookmark bar pref changing. | |
| 904 BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE, | |
| 905 | |
| 906 // Change is the result of a state change in the active tab. | |
| 907 BOOKMARK_BAR_STATE_CHANGE_TAB_STATE, | |
| 908 | |
| 909 // Change is the result of window toggling in/out of fullscreen mode. | |
| 910 BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN, | |
| 911 }; | |
| 912 | |
| 913 // Overridden from content::WebContentsDelegate: | 861 // Overridden from content::WebContentsDelegate: |
| 914 virtual content::WebContents* OpenURLFromTab( | 862 virtual content::WebContents* OpenURLFromTab( |
| 915 content::WebContents* source, | 863 content::WebContents* source, |
| 916 const content::OpenURLParams& params) OVERRIDE; | 864 const content::OpenURLParams& params) OVERRIDE; |
| 917 virtual void NavigationStateChanged(const content::WebContents* source, | 865 virtual void NavigationStateChanged(const content::WebContents* source, |
| 918 unsigned changed_flags) OVERRIDE; | 866 unsigned changed_flags) OVERRIDE; |
| 919 virtual void AddNewContents(content::WebContents* source, | 867 virtual void AddNewContents(content::WebContents* source, |
| 920 content::WebContents* new_contents, | 868 content::WebContents* new_contents, |
| 921 WindowOpenDisposition disposition, | 869 WindowOpenDisposition disposition, |
| 922 const gfx::Rect& initial_pos, | 870 const gfx::Rect& initial_pos, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 const string16& title, | 960 const string16& title, |
| 1013 const string16& disposition) OVERRIDE; | 961 const string16& disposition) OVERRIDE; |
| 1014 virtual void WebIntentDispatch( | 962 virtual void WebIntentDispatch( |
| 1015 content::WebContents* tab, | 963 content::WebContents* tab, |
| 1016 content::WebIntentsDispatcher* intents_dispatcher) OVERRIDE; | 964 content::WebIntentsDispatcher* intents_dispatcher) OVERRIDE; |
| 1017 virtual void UpdatePreferredSize(content::WebContents* source, | 965 virtual void UpdatePreferredSize(content::WebContents* source, |
| 1018 const gfx::Size& pref_size) OVERRIDE; | 966 const gfx::Size& pref_size) OVERRIDE; |
| 1019 virtual void ResizeDueToAutoResize(content::WebContents* source, | 967 virtual void ResizeDueToAutoResize(content::WebContents* source, |
| 1020 const gfx::Size& new_size) OVERRIDE; | 968 const gfx::Size& new_size) OVERRIDE; |
| 1021 | 969 |
| 970 protected: |
| 971 // Wrapper for the factory method in BrowserWindow. This allows subclasses to |
| 972 // set their own window. |
| 973 virtual BrowserWindow* CreateBrowserWindow(); |
| 974 |
| 975 private: |
| 976 friend class BrowserTest; |
| 977 FRIEND_TEST_ALL_PREFIXES(AppModeTest, EnableAppModeTest); |
| 978 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups); |
| 979 FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut); |
| 980 FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp); |
| 981 FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch); |
| 982 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TabEntersPresentationModeFromWindowed); |
| 983 FRIEND_TEST_ALL_PREFIXES(FullscreenExitBubbleControllerTest, |
| 984 DenyExitsFullscreen); |
| 985 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutNoPref); |
| 986 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
| 987 OpenAppShortcutWindowPref); |
| 988 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutTabPref); |
| 989 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutPanel); |
| 990 |
| 991 // Used to describe why a tab is being detached. This is used by |
| 992 // TabDetachedAtImpl. |
| 993 enum DetachType { |
| 994 // Result of TabDetachedAt. |
| 995 DETACH_TYPE_DETACH, |
| 996 |
| 997 // Result of TabReplacedAt. |
| 998 DETACH_TYPE_REPLACE, |
| 999 |
| 1000 // Result of the tab strip not having any significant tabs. |
| 1001 DETACH_TYPE_EMPTY |
| 1002 }; |
| 1003 |
| 1004 // Describes where the bookmark bar state change originated from. |
| 1005 enum BookmarkBarStateChangeReason { |
| 1006 // From the constructor. |
| 1007 BOOKMARK_BAR_STATE_CHANGE_INIT, |
| 1008 |
| 1009 // Change is the result of the active tab changing. |
| 1010 BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH, |
| 1011 |
| 1012 // Change is the result of the bookmark bar pref changing. |
| 1013 BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE, |
| 1014 |
| 1015 // Change is the result of a state change in the active tab. |
| 1016 BOOKMARK_BAR_STATE_CHANGE_TAB_STATE, |
| 1017 |
| 1018 // Change is the result of window toggling in/out of fullscreen mode. |
| 1019 BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN, |
| 1020 }; |
| 1021 |
| 1022 virtual void FindReply(content::WebContents* tab, | 1022 virtual void FindReply(content::WebContents* tab, |
| 1023 int request_id, | 1023 int request_id, |
| 1024 int number_of_matches, | 1024 int number_of_matches, |
| 1025 const gfx::Rect& selection_rect, | 1025 const gfx::Rect& selection_rect, |
| 1026 int active_match_ordinal, | 1026 int active_match_ordinal, |
| 1027 bool final_update) OVERRIDE; | 1027 bool final_update) OVERRIDE; |
| 1028 | 1028 |
| 1029 virtual void RequestToLockMouse(content::WebContents* tab, | 1029 virtual void RequestToLockMouse(content::WebContents* tab, |
| 1030 bool user_gesture) OVERRIDE; | 1030 bool user_gesture) OVERRIDE; |
| 1031 virtual void LostMouseLock() OVERRIDE; | 1031 virtual void LostMouseLock() OVERRIDE; |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 bool window_has_shown_; | 1454 bool window_has_shown_; |
| 1455 | 1455 |
| 1456 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 1456 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
| 1457 // before DidEndColorChooser is called. | 1457 // before DidEndColorChooser is called. |
| 1458 scoped_ptr<content::ColorChooser> color_chooser_; | 1458 scoped_ptr<content::ColorChooser> color_chooser_; |
| 1459 | 1459 |
| 1460 DISALLOW_COPY_AND_ASSIGN(Browser); | 1460 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 1461 }; | 1461 }; |
| 1462 | 1462 |
| 1463 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1463 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |