OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_H_ |
6 #define CHROME_BROWSER_BROWSER_H_ | 6 #define CHROME_BROWSER_BROWSER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 SiteInstance* instance); | 249 SiteInstance* instance); |
250 | 250 |
251 // Add a new tab, given a TabContents. A TabContents appropriate to | 251 // Add a new tab, given a TabContents. A TabContents appropriate to |
252 // display the last committed entry is created and returned. | 252 // display the last committed entry is created and returned. |
253 TabContents* AddTab(TabContents* tab_contents, PageTransition::Type type); | 253 TabContents* AddTab(TabContents* tab_contents, PageTransition::Type type); |
254 | 254 |
255 // Add a tab with its session history restored from the SessionRestore | 255 // Add a tab with its session history restored from the SessionRestore |
256 // system. If select is true, the tab is selected. |tab_index| gives the index | 256 // system. If select is true, the tab is selected. |tab_index| gives the index |
257 // to insert the tab at. |selected_navigation| is the index of the | 257 // to insert the tab at. |selected_navigation| is the index of the |
258 // TabNavigation in |navigations| to select. If |pin| is true and |tab_index| | 258 // TabNavigation in |navigations| to select. If |pin| is true and |tab_index| |
259 // is the last pinned tab, then the newly created tab is pinned. | 259 // is the last pinned tab, then the newly created tab is pinned. If |
| 260 // |from_last_session| is true, |navigations| are from the previous session. |
260 TabContents* AddRestoredTab(const std::vector<TabNavigation>& navigations, | 261 TabContents* AddRestoredTab(const std::vector<TabNavigation>& navigations, |
261 int tab_index, | 262 int tab_index, |
262 int selected_navigation, | 263 int selected_navigation, |
263 bool select, | 264 bool select, |
264 bool pin); | 265 bool pin, |
| 266 bool from_last_session); |
265 // Creates a new tab with the already-created TabContents 'new_contents'. | 267 // Creates a new tab with the already-created TabContents 'new_contents'. |
266 // The window for the added contents will be reparented correctly when this | 268 // The window for the added contents will be reparented correctly when this |
267 // method returns. If |disposition| is NEW_POPUP, |pos| should hold the | 269 // method returns. If |disposition| is NEW_POPUP, |pos| should hold the |
268 // initial position. | 270 // initial position. |
269 void AddTabContents(TabContents* new_contents, | 271 void AddTabContents(TabContents* new_contents, |
270 WindowOpenDisposition disposition, | 272 WindowOpenDisposition disposition, |
271 const gfx::Rect& initial_pos, | 273 const gfx::Rect& initial_pos, |
272 bool user_gesture); | 274 bool user_gesture); |
273 void CloseTabContents(TabContents* contents); | 275 void CloseTabContents(TabContents* contents); |
274 | 276 |
(...skipping 12 matching lines...) Expand all Loading... |
287 void ToolbarSizeChanged(bool is_animating); | 289 void ToolbarSizeChanged(bool is_animating); |
288 | 290 |
289 // Notification that the extension shelf has changed size (as a result of | 291 // Notification that the extension shelf has changed size (as a result of |
290 // becoming detached or attached). | 292 // becoming detached or attached). |
291 void ExtensionShelfSizeChanged(); | 293 void ExtensionShelfSizeChanged(); |
292 | 294 |
293 // Replaces the state of the currently selected tab with the session | 295 // Replaces the state of the currently selected tab with the session |
294 // history restored from the SessionRestore system. | 296 // history restored from the SessionRestore system. |
295 void ReplaceRestoredTab( | 297 void ReplaceRestoredTab( |
296 const std::vector<TabNavigation>& navigations, | 298 const std::vector<TabNavigation>& navigations, |
297 int selected_navigation); | 299 int selected_navigation, |
| 300 bool from_last_session); |
298 | 301 |
299 // Returns true if a tab can be restored. | 302 // Returns true if a tab can be restored. |
300 virtual bool CanRestoreTab(); | 303 virtual bool CanRestoreTab(); |
301 | 304 |
302 // Show a DOMUI tab given a URL. If a tab with the same URL is already | 305 // Show a DOMUI tab given a URL. If a tab with the same URL is already |
303 // visible in this browser, it becomes selected. Otherwise a new tab is | 306 // visible in this browser, it becomes selected. Otherwise a new tab is |
304 // created. | 307 // created. |
305 void ShowSingleDOMUITab(const GURL& url); | 308 void ShowSingleDOMUITab(const GURL& url); |
306 | 309 |
307 // Update commands whose state depends on whether the window is in fullscreen | 310 // Update commands whose state depends on whether the window is in fullscreen |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 // this to return NULL if called before the toolbar has initialized. | 619 // this to return NULL if called before the toolbar has initialized. |
617 // TODO(beng): remove this. | 620 // TODO(beng): remove this. |
618 StatusBubble* GetStatusBubble(); | 621 StatusBubble* GetStatusBubble(); |
619 | 622 |
620 // Session restore functions //////////////////////////////////////////////// | 623 // Session restore functions //////////////////////////////////////////////// |
621 | 624 |
622 // Notifies the history database of the index for all tabs whose index is | 625 // Notifies the history database of the index for all tabs whose index is |
623 // >= index. | 626 // >= index. |
624 void SyncHistoryWithTabs(int index); | 627 void SyncHistoryWithTabs(int index); |
625 | 628 |
626 // Called from AddRestoredTab and ReplaceRestoredTab to build a | |
627 // TabContents from an incoming vector of TabNavigations. | |
628 // Caller takes ownership of the returned TabContents. | |
629 TabContents* BuildRestoredTab(const std::vector<TabNavigation>& navigations, | |
630 int selected_navigation); | |
631 | |
632 // OnBeforeUnload handling ////////////////////////////////////////////////// | 629 // OnBeforeUnload handling ////////////////////////////////////////////////// |
633 | 630 |
634 typedef std::set<TabContents*> UnloadListenerSet; | 631 typedef std::set<TabContents*> UnloadListenerSet; |
635 | 632 |
636 // Processes the next tab that needs it's beforeunload/unload event fired. | 633 // Processes the next tab that needs it's beforeunload/unload event fired. |
637 void ProcessPendingTabs(); | 634 void ProcessPendingTabs(); |
638 | 635 |
639 // Whether we've completed firing all the tabs' beforeunload/unload events. | 636 // Whether we've completed firing all the tabs' beforeunload/unload events. |
640 bool HasCompletedUnloadProcessing() const; | 637 bool HasCompletedUnloadProcessing() const; |
641 | 638 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 // Dialog box used for opening and saving files. | 812 // Dialog box used for opening and saving files. |
816 scoped_refptr<SelectFileDialog> select_file_dialog_; | 813 scoped_refptr<SelectFileDialog> select_file_dialog_; |
817 | 814 |
818 // Keep track of the encoding auto detect pref. | 815 // Keep track of the encoding auto detect pref. |
819 BooleanPrefMember encoding_auto_detect_; | 816 BooleanPrefMember encoding_auto_detect_; |
820 | 817 |
821 DISALLOW_COPY_AND_ASSIGN(Browser); | 818 DISALLOW_COPY_AND_ASSIGN(Browser); |
822 }; | 819 }; |
823 | 820 |
824 #endif // CHROME_BROWSER_BROWSER_H_ | 821 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |