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

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

Issue 10412061: Fix crashes in DownloadRequestLimiter when extension popups/bubbles initiate downloads automatically (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 7 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) 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 void ShowFirstRunBubble(); 811 void ShowFirstRunBubble();
812 812
813 void set_pending_web_app_action(WebAppAction action) { 813 void set_pending_web_app_action(WebAppAction action) {
814 pending_web_app_action_ = action; 814 pending_web_app_action_ = action;
815 } 815 }
816 816
817 ExtensionWindowController* extension_window_controller() const { 817 ExtensionWindowController* extension_window_controller() const {
818 return extension_window_controller_.get(); 818 return extension_window_controller_.get();
819 } 819 }
820 820
821 protected:
822 // Wrapper for the factory method in BrowserWindow. This allows subclasses to
823 // set their own window.
824 virtual BrowserWindow* CreateBrowserWindow();
825
826 private:
827 friend class BrowserTest;
828 FRIEND_TEST_ALL_PREFIXES(AppModeTest, EnableAppModeTest);
829 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups);
830 FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut);
831 FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp);
832 FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch);
833 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TabEntersPresentationModeFromWindowed);
834 FRIEND_TEST_ALL_PREFIXES(FullscreenExitBubbleControllerTest,
835 DenyExitsFullscreen);
836 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutNoPref);
837 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest,
838 OpenAppShortcutWindowPref);
839 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutTabPref);
840 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutPanel);
841
842 // Used to describe why a tab is being detached. This is used by
843 // TabDetachedAtImpl.
844 enum DetachType {
845 // Result of TabDetachedAt.
846 DETACH_TYPE_DETACH,
847
848 // Result of TabReplacedAt.
849 DETACH_TYPE_REPLACE,
850
851 // Result of the tab strip not having any significant tabs.
852 DETACH_TYPE_EMPTY
853 };
854
855 // Describes where the bookmark bar state change originated from.
856 enum BookmarkBarStateChangeReason {
857 // From the constructor.
858 BOOKMARK_BAR_STATE_CHANGE_INIT,
859
860 // Change is the result of the active tab changing.
861 BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH,
862
863 // Change is the result of the bookmark bar pref changing.
864 BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE,
865
866 // Change is the result of a state change in the active tab.
867 BOOKMARK_BAR_STATE_CHANGE_TAB_STATE,
868
869 // Change is the result of window toggling in/out of fullscreen mode.
870 BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN,
871 };
872
873 // Overridden from content::WebContentsDelegate: 821 // Overridden from content::WebContentsDelegate:
Ben Goodger (Google) 2012/05/29 18:23:48 ... and also, I don't like having these methods ex
874 virtual content::WebContents* OpenURLFromTab( 822 virtual content::WebContents* OpenURLFromTab(
875 content::WebContents* source, 823 content::WebContents* source,
876 const content::OpenURLParams& params) OVERRIDE; 824 const content::OpenURLParams& params) OVERRIDE;
877 virtual void NavigationStateChanged(const content::WebContents* source, 825 virtual void NavigationStateChanged(const content::WebContents* source,
878 unsigned changed_flags) OVERRIDE; 826 unsigned changed_flags) OVERRIDE;
879 virtual void AddNewContents(content::WebContents* source, 827 virtual void AddNewContents(content::WebContents* source,
880 content::WebContents* new_contents, 828 content::WebContents* new_contents,
881 WindowOpenDisposition disposition, 829 WindowOpenDisposition disposition,
882 const gfx::Rect& initial_pos, 830 const gfx::Rect& initial_pos,
883 bool user_gesture) OVERRIDE; 831 bool user_gesture) OVERRIDE;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 const string16& title, 920 const string16& title,
973 const string16& disposition) OVERRIDE; 921 const string16& disposition) OVERRIDE;
974 virtual void WebIntentDispatch( 922 virtual void WebIntentDispatch(
975 content::WebContents* tab, 923 content::WebContents* tab,
976 content::WebIntentsDispatcher* intents_dispatcher) OVERRIDE; 924 content::WebIntentsDispatcher* intents_dispatcher) OVERRIDE;
977 virtual void UpdatePreferredSize(content::WebContents* source, 925 virtual void UpdatePreferredSize(content::WebContents* source,
978 const gfx::Size& pref_size) OVERRIDE; 926 const gfx::Size& pref_size) OVERRIDE;
979 virtual void ResizeDueToAutoResize(content::WebContents* source, 927 virtual void ResizeDueToAutoResize(content::WebContents* source,
980 const gfx::Size& new_size) OVERRIDE; 928 const gfx::Size& new_size) OVERRIDE;
981 929
930 protected:
931 // Wrapper for the factory method in BrowserWindow. This allows subclasses to
932 // set their own window.
933 virtual BrowserWindow* CreateBrowserWindow();
934
935 private:
936 friend class BrowserTest;
937 FRIEND_TEST_ALL_PREFIXES(AppModeTest, EnableAppModeTest);
938 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups);
939 FRIEND_TEST_ALL_PREFIXES(BrowserTest, ConvertTabToAppShortcut);
940 FRIEND_TEST_ALL_PREFIXES(BrowserTest, OpenAppWindowLikeNtp);
941 FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch);
942 FRIEND_TEST_ALL_PREFIXES(BrowserTest, TabEntersPresentationModeFromWindowed);
943 FRIEND_TEST_ALL_PREFIXES(FullscreenExitBubbleControllerTest,
944 DenyExitsFullscreen);
945 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutNoPref);
946 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest,
947 OpenAppShortcutWindowPref);
948 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutTabPref);
949 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, OpenAppShortcutPanel);
950
951 // Used to describe why a tab is being detached. This is used by
952 // TabDetachedAtImpl.
953 enum DetachType {
954 // Result of TabDetachedAt.
955 DETACH_TYPE_DETACH,
956
957 // Result of TabReplacedAt.
958 DETACH_TYPE_REPLACE,
959
960 // Result of the tab strip not having any significant tabs.
961 DETACH_TYPE_EMPTY
962 };
963
964 // Describes where the bookmark bar state change originated from.
965 enum BookmarkBarStateChangeReason {
966 // From the constructor.
967 BOOKMARK_BAR_STATE_CHANGE_INIT,
968
969 // Change is the result of the active tab changing.
970 BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH,
971
972 // Change is the result of the bookmark bar pref changing.
973 BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE,
974
975 // Change is the result of a state change in the active tab.
976 BOOKMARK_BAR_STATE_CHANGE_TAB_STATE,
977
978 // Change is the result of window toggling in/out of fullscreen mode.
979 BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN,
980 };
981
982 virtual void FindReply(content::WebContents* tab, 982 virtual void FindReply(content::WebContents* tab,
983 int request_id, 983 int request_id,
984 int number_of_matches, 984 int number_of_matches,
985 const gfx::Rect& selection_rect, 985 const gfx::Rect& selection_rect,
986 int active_match_ordinal, 986 int active_match_ordinal,
987 bool final_update) OVERRIDE; 987 bool final_update) OVERRIDE;
988 988
989 virtual void RequestToLockMouse(content::WebContents* tab, 989 virtual void RequestToLockMouse(content::WebContents* tab,
990 bool user_gesture) OVERRIDE; 990 bool user_gesture) OVERRIDE;
991 virtual void LostMouseLock() OVERRIDE; 991 virtual void LostMouseLock() OVERRIDE;
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 bool window_has_shown_; 1406 bool window_has_shown_;
1407 1407
1408 // Currently open color chooser. Non-NULL after OpenColorChooser is called and 1408 // Currently open color chooser. Non-NULL after OpenColorChooser is called and
1409 // before DidEndColorChooser is called. 1409 // before DidEndColorChooser is called.
1410 scoped_ptr<content::ColorChooser> color_chooser_; 1410 scoped_ptr<content::ColorChooser> color_chooser_;
1411 1411
1412 DISALLOW_COPY_AND_ASSIGN(Browser); 1412 DISALLOW_COPY_AND_ASSIGN(Browser);
1413 }; 1413 };
1414 1414
1415 #endif // CHROME_BROWSER_UI_BROWSER_H_ 1415 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698