OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 // Creates a new Browser if none are available. | 627 // Creates a new Browser if none are available. |
628 static Browser* GetOrCreateTabbedBrowser(Profile* profile); | 628 static Browser* GetOrCreateTabbedBrowser(Profile* profile); |
629 | 629 |
630 // Calls ExecuteCommandWithDisposition with the given disposition. | 630 // Calls ExecuteCommandWithDisposition with the given disposition. |
631 void ExecuteCommandWithDisposition(int id, WindowOpenDisposition); | 631 void ExecuteCommandWithDisposition(int id, WindowOpenDisposition); |
632 | 632 |
633 // Executes a command if it's enabled. | 633 // Executes a command if it's enabled. |
634 // Returns true if the command is executed. | 634 // Returns true if the command is executed. |
635 bool ExecuteCommandIfEnabled(int id); | 635 bool ExecuteCommandIfEnabled(int id); |
636 | 636 |
| 637 // Executes a command from a tab content's context menu. |
| 638 // Return true if handled. |
| 639 bool ExecuteContextMenuCommand(int id, int event_flags); |
| 640 |
637 // Returns true if |command_id| is a reserved command whose keyboard shortcuts | 641 // Returns true if |command_id| is a reserved command whose keyboard shortcuts |
638 // should not be sent to the renderer or |event| was triggered by a key that | 642 // should not be sent to the renderer or |event| was triggered by a key that |
639 // we never want to send to the renderer. | 643 // we never want to send to the renderer. |
640 bool IsReservedCommandOrKey(int command_id, | 644 bool IsReservedCommandOrKey(int command_id, |
641 const NativeWebKeyboardEvent& event); | 645 const NativeWebKeyboardEvent& event); |
642 | 646 |
643 // Sets if command execution shall be blocked. If |block| is true then | 647 // Sets if command execution shall be blocked. If |block| is true then |
644 // following calls to ExecuteCommand() or ExecuteCommandWithDisposition() | 648 // following calls to ExecuteCommand() or ExecuteCommandWithDisposition() |
645 // method will not execute the command, and the last blocked command will be | 649 // method will not execute the command, and the last blocked command will be |
646 // recorded for retrieval. | 650 // recorded for retrieval. |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 | 1045 |
1042 // Create a preference dictionary for the provided application name, in the | 1046 // Create a preference dictionary for the provided application name, in the |
1043 // given user profile. This is done only once per application name / per | 1047 // given user profile. This is done only once per application name / per |
1044 // session / per user profile. | 1048 // session / per user profile. |
1045 static void RegisterAppPrefs(const std::string& app_name, Profile* profile); | 1049 static void RegisterAppPrefs(const std::string& app_name, Profile* profile); |
1046 | 1050 |
1047 // Shared code between Reload() and ReloadIgnoringCache(). | 1051 // Shared code between Reload() and ReloadIgnoringCache(). |
1048 void ReloadInternal(WindowOpenDisposition disposition, bool ignore_cache); | 1052 void ReloadInternal(WindowOpenDisposition disposition, bool ignore_cache); |
1049 | 1053 |
1050 // Return true if the window dispositions means opening a new tab. | 1054 // Return true if the window dispositions means opening a new tab. |
1051 bool ShouldOpenNewTabForWindowDisposition(WindowOpenDisposition disposition); | 1055 bool ShouldOpenNewTabForDisposition(WindowOpenDisposition disposition); |
1052 | 1056 |
1053 // Depending on the disposition, return the current tab or a clone of the | 1057 // Depending on the disposition, return the current tab or a clone of the |
1054 // current tab. | 1058 // current tab. |
1055 TabContents* GetOrCloneTabForDisposition(WindowOpenDisposition disposition); | 1059 TabContents* GetOrCloneTabForDisposition(WindowOpenDisposition disposition); |
1056 | 1060 |
| 1061 // Depending on the disposition, return the wrapper containing the current |
| 1062 // tab or a clone of the current tab. |
| 1063 TabContentsWrapper* GetOrCloneTabWrapperForDisposition( |
| 1064 WindowOpenDisposition disposition); |
| 1065 |
| 1066 // Depending on the disposition, create a new browser. |
| 1067 // When disposition is NEW_WINDOW, |tab_contents| will be added to |
| 1068 // a new browser which is created in this method. |
| 1069 void CreateNewBrowserForDisposition(TabContentsWrapper* tab_contents, |
| 1070 WindowOpenDisposition disposition); |
| 1071 |
1057 // Sets the insertion policy of the tabstrip based on whether vertical tabs | 1072 // Sets the insertion policy of the tabstrip based on whether vertical tabs |
1058 // are enabled. | 1073 // are enabled. |
1059 void UpdateTabStripModelInsertionPolicy(); | 1074 void UpdateTabStripModelInsertionPolicy(); |
1060 | 1075 |
1061 // Invoked when the use vertical tabs preference changes. Resets the insertion | 1076 // Invoked when the use vertical tabs preference changes. Resets the insertion |
1062 // policy of the tab strip model and notifies the window. | 1077 // policy of the tab strip model and notifies the window. |
1063 void UseVerticalTabsChanged(); | 1078 void UseVerticalTabsChanged(); |
1064 | 1079 |
1065 // Invoked when the use of the compact navigation bar preference changes. | 1080 // Invoked when the use of the compact navigation bar preference changes. |
1066 // Notifies the window. | 1081 // Notifies the window. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 // Helper which implements the TabRestoreServiceDelegate interface. | 1254 // Helper which implements the TabRestoreServiceDelegate interface. |
1240 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_; | 1255 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_; |
1241 | 1256 |
1242 scoped_ptr<InstantController> instant_; | 1257 scoped_ptr<InstantController> instant_; |
1243 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; | 1258 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; |
1244 | 1259 |
1245 DISALLOW_COPY_AND_ASSIGN(Browser); | 1260 DISALLOW_COPY_AND_ASSIGN(Browser); |
1246 }; | 1261 }; |
1247 | 1262 |
1248 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1263 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |