Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: chrome/browser/tab_contents/tab_contents.h

Issue 115740: Move download shelf from per-tab to per-window (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_TAB_CONTENTS_TAB_CONTENTS_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 namespace IPC { 59 namespace IPC {
60 class Message; 60 class Message;
61 } 61 }
62 62
63 class AutofillForm; 63 class AutofillForm;
64 class AutofillManager; 64 class AutofillManager;
65 class BlockedPopupContainer; 65 class BlockedPopupContainer;
66 class DOMUI; 66 class DOMUI;
67 class DOMUIContents; 67 class DOMUIContents;
68 class DownloadItem; 68 class DownloadItem;
69 class DownloadShelf;
70 class LoadNotificationDetails; 69 class LoadNotificationDetails;
71 class PageAction; 70 class PageAction;
72 class PasswordManager; 71 class PasswordManager;
73 class PluginInstaller; 72 class PluginInstaller;
74 class Profile; 73 class Profile;
75 class RenderViewHost; 74 class RenderViewHost;
76 class TabContentsDelegate; 75 class TabContentsDelegate;
77 class TabContentsFactory; 76 class TabContentsFactory;
78 class SkBitmap; 77 class SkBitmap;
79 class SiteInstance; 78 class SiteInstance;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 int infobar_delegate_count() const { return infobar_delegates_.size(); } 397 int infobar_delegate_count() const { return infobar_delegates_.size(); }
399 InfoBarDelegate* GetInfoBarDelegateAt(int index) { 398 InfoBarDelegate* GetInfoBarDelegateAt(int index) {
400 return infobar_delegates_.at(index); 399 return infobar_delegates_.at(index);
401 } 400 }
402 401
403 // Toolbars and such --------------------------------------------------------- 402 // Toolbars and such ---------------------------------------------------------
404 403
405 // Returns whether the bookmark bar should be visible. 404 // Returns whether the bookmark bar should be visible.
406 virtual bool IsBookmarkBarAlwaysVisible(); 405 virtual bool IsBookmarkBarAlwaysVisible();
407 406
408 // Whether or not the shelf view is visible. 407 // Notifies the delegate that a download started.
409 virtual void SetDownloadShelfVisible(bool visible); 408 void OnStartDownload(DownloadItem* download);
410 bool IsDownloadShelfVisible() { return shelf_visible_; }
411 409
412 // Notify our delegate that some of our content has animated. 410 // Notify our delegate that some of our content has animated.
413 void ToolbarSizeChanged(bool is_animating); 411 void ToolbarSizeChanged(bool is_animating);
414 412
415 // Displays the download shelf and animation when a download occurs.
416 void OnStartDownload(DownloadItem* download);
417
418 // Returns the DownloadShelf. If the shelf doesn't exist and |create| is true,
419 // this function will create the shelf.
420 DownloadShelf* GetDownloadShelf(bool create);
421
422 // Transfer the shelf view from |tab_contents| to the receiving TabContents.
423 // |tab_contents| no longer owns the shelf after this call. The shelf is owned
424 // by the receiving TabContents.
425 void MigrateShelfFrom(TabContents* tab_contents);
426
427 // Migrate the shelf view between 2 TabContents. This helper function is
428 // currently called by NavigationController::DiscardPendingEntry. We may
429 // want to generalize this if we need to migrate some other state.
430 static void MigrateShelf(TabContents* from, TabContents* to);
431
432 // Called when a ConstrainedWindow we own is about to be closed. 413 // Called when a ConstrainedWindow we own is about to be closed.
433 void WillClose(ConstrainedWindow* window); 414 void WillClose(ConstrainedWindow* window);
434 415
435 // Called when a BlockedPopupContainer we own is about to be closed. 416 // Called when a BlockedPopupContainer we own is about to be closed.
436 void WillCloseBlockedPopupContainer(BlockedPopupContainer* container); 417 void WillCloseBlockedPopupContainer(BlockedPopupContainer* container);
437 418
438 // Called when a ConstrainedWindow we own is moved or resized. 419 // Called when a ConstrainedWindow we own is moved or resized.
439 void DidMoveOrResize(ConstrainedWindow* window); 420 void DidMoveOrResize(ConstrainedWindow* window);
440 421
441 // Interstitials ------------------------------------------------------------- 422 // Interstitials -------------------------------------------------------------
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // Called by a derived class when the TabContents is resized, causing 622 // Called by a derived class when the TabContents is resized, causing
642 // suppressed constrained web popups to be repositioned to the new bounds 623 // suppressed constrained web popups to be repositioned to the new bounds
643 // if necessary. 624 // if necessary.
644 void RepositionSupressedPopupsToFit(); 625 void RepositionSupressedPopupsToFit();
645 626
646 // Whether we have a notification AND the notification owns popups windows. 627 // Whether we have a notification AND the notification owns popups windows.
647 // (We keep the notification object around even when it's not shown since it 628 // (We keep the notification object around even when it's not shown since it
648 // determines whether to show itself). 629 // determines whether to show itself).
649 bool ShowingBlockedPopupNotification() const; 630 bool ShowingBlockedPopupNotification() const;
650 631
651 // Releases the download shelf. This method is used by MigrateShelfFrom.
652 void ReleaseDownloadShelf();
653
654 // Called by derived classes to indicate that we're no longer waiting for a 632 // Called by derived classes to indicate that we're no longer waiting for a
655 // response. This won't actually update the throbber, but it will get picked 633 // response. This won't actually update the throbber, but it will get picked
656 // up at the next animation step if the throbber is going. 634 // up at the next animation step if the throbber is going.
657 void SetNotWaitingForResponse() { waiting_for_response_ = false; } 635 void SetNotWaitingForResponse() { waiting_for_response_ = false; }
658 636
659 typedef std::vector<ConstrainedWindow*> ConstrainedWindowList; 637 typedef std::vector<ConstrainedWindow*> ConstrainedWindowList;
660 ConstrainedWindowList child_windows_; 638 ConstrainedWindowList child_windows_;
661 639
662 // Expires InfoBars that need to be expired, according to the state carried 640 // Expires InfoBars that need to be expired, according to the state carried
663 // in |details|, in response to a new NavigationEntry being committed (the 641 // in |details|, in response to a new NavigationEntry being committed (the
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 970
993 // When a navigation occurs, we record its contents MIME type. It can be 971 // When a navigation occurs, we record its contents MIME type. It can be
994 // used to check whether we can do something for some special contents. 972 // used to check whether we can do something for some special contents.
995 std::string contents_mime_type_; 973 std::string contents_mime_type_;
996 974
997 // Character encoding. TODO(jungshik) : convert to std::string 975 // Character encoding. TODO(jungshik) : convert to std::string
998 std::wstring encoding_; 976 std::wstring encoding_;
999 977
1000 // Data for shelves and stuff ------------------------------------------------ 978 // Data for shelves and stuff ------------------------------------------------
1001 979
1002 // The download shelf view (view at the bottom of the page).
1003 scoped_ptr<DownloadShelf> download_shelf_;
1004
1005 // Whether the shelf view is visible.
1006 bool shelf_visible_;
1007
1008 // ConstrainedWindow with additional methods for managing blocked 980 // ConstrainedWindow with additional methods for managing blocked
1009 // popups. 981 // popups.
1010 BlockedPopupContainer* blocked_popups_; 982 BlockedPopupContainer* blocked_popups_;
1011 983
1012 // Delegates for InfoBars associated with this TabContents. 984 // Delegates for InfoBars associated with this TabContents.
1013 std::vector<InfoBarDelegate*> infobar_delegates_; 985 std::vector<InfoBarDelegate*> infobar_delegates_;
1014 986
1015 // The last time that the download shelf was made visible.
1016 base::TimeTicks last_download_shelf_show_;
1017
1018 // Data for find in page ----------------------------------------------------- 987 // Data for find in page -----------------------------------------------------
1019 988
1020 // TODO(brettw) this should be separated into a helper class. 989 // TODO(brettw) this should be separated into a helper class.
1021 990
1022 // Each time a search request comes in we assign it an id before passing it 991 // Each time a search request comes in we assign it an id before passing it
1023 // over the IPC so that when the results come in we can evaluate whether we 992 // over the IPC so that when the results come in we can evaluate whether we
1024 // still care about the results of the search (in some cases we don't because 993 // still care about the results of the search (in some cases we don't because
1025 // the user has issued a new search). 994 // the user has issued a new search).
1026 static int find_request_id_counter_; 995 static int find_request_id_counter_;
1027 996
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 // True if the user has decided to block future javascript messages. This is 1060 // True if the user has decided to block future javascript messages. This is
1092 // reset on navigations to false on navigations. 1061 // reset on navigations to false on navigations.
1093 bool suppress_javascript_messages_; 1062 bool suppress_javascript_messages_;
1094 1063
1095 // --------------------------------------------------------------------------- 1064 // ---------------------------------------------------------------------------
1096 1065
1097 DISALLOW_COPY_AND_ASSIGN(TabContents); 1066 DISALLOW_COPY_AND_ASSIGN(TabContents);
1098 }; 1067 };
1099 1068
1100 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 1069 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698