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

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

Issue 2650923002: Fixes ungraceful handling of destroyed GlobalError GlobalErrorBubbleView. (Closed)
Patch Set: Use fake instead of mock button listener Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/global_error_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_GLOBAL_ERROR_GLOBAL_ERROR_H_ 5 #ifndef CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_
6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ 6 #define CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Returns true if the bubble needs a close(x) button. 80 // Returns true if the bubble needs a close(x) button.
81 virtual bool ShouldShowCloseButton() const; 81 virtual bool ShouldShowCloseButton() const;
82 // Returns true if the accept button needs elevation icon (only effective 82 // Returns true if the accept button needs elevation icon (only effective
83 // on Windows platform). 83 // on Windows platform).
84 virtual bool ShouldAddElevationIconToAcceptButton(); 84 virtual bool ShouldAddElevationIconToAcceptButton();
85 // Returns the cancel button label for the bubble view. To hide the cancel 85 // Returns the cancel button label for the bubble view. To hide the cancel
86 // button return an empty string. 86 // button return an empty string.
87 virtual base::string16 GetBubbleViewCancelButtonLabel() = 0; 87 virtual base::string16 GetBubbleViewCancelButtonLabel() = 0;
88 // Called when the bubble view is closed. |browser| is the Browser that the 88 // Called when the bubble view is closed. |browser| is the Browser that the
89 // bubble view was shown on. 89 // bubble view was shown on.
90 void BubbleViewDidClose(Browser* browser); 90 virtual void BubbleViewDidClose(Browser* browser);
91 // Notifies subclasses that the bubble view is closed. |browser| is the 91 // Notifies subclasses that the bubble view is closed. |browser| is the
92 // Browser that the bubble view was shown on. 92 // Browser that the bubble view was shown on.
93 virtual void OnBubbleViewDidClose(Browser* browser) = 0; 93 virtual void OnBubbleViewDidClose(Browser* browser) = 0;
94 // Called when the user clicks on the accept button. |browser| is the 94 // Called when the user clicks on the accept button. |browser| is the
95 // Browser that the bubble view was shown on. 95 // Browser that the bubble view was shown on.
96 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0; 96 virtual void BubbleViewAcceptButtonPressed(Browser* browser) = 0;
97 // Called when the user clicks the cancel button. |browser| is the 97 // Called when the user clicks the cancel button. |browser| is the
98 // Browser that the bubble view was shown on. 98 // Browser that the bubble view was shown on.
99 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0; 99 virtual void BubbleViewCancelButtonPressed(Browser* browser) = 0;
100 // Returns true if the bubble should close when focus is lost. If false, the 100 // Returns true if the bubble should close when focus is lost. If false, the
101 // bubble will stick around until the user explicitly acknowledges it. 101 // bubble will stick around until the user explicitly acknowledges it.
102 // Defaults to true. 102 // Defaults to true.
103 virtual bool ShouldCloseOnDeactivate() const; 103 virtual bool ShouldCloseOnDeactivate() const;
104 104
105 // GlobalError overrides: 105 // GlobalError overrides:
106 bool HasBubbleView() override; 106 bool HasBubbleView() override;
107 bool HasShownBubbleView() override; 107 bool HasShownBubbleView() override;
108 void ShowBubbleView(Browser* browser) override; 108 void ShowBubbleView(Browser* browser) override;
109 GlobalErrorBubbleViewBase* GetBubbleView() override; 109 GlobalErrorBubbleViewBase* GetBubbleView() override;
110 110
111 private: 111 private:
112 bool has_shown_bubble_view_; 112 bool has_shown_bubble_view_;
113 GlobalErrorBubbleViewBase* bubble_view_; 113 GlobalErrorBubbleViewBase* bubble_view_;
114 114
115 DISALLOW_COPY_AND_ASSIGN(GlobalErrorWithStandardBubble); 115 DISALLOW_COPY_AND_ASSIGN(GlobalErrorWithStandardBubble);
116 }; 116 };
117 117
118 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_ 118 #endif // CHROME_BROWSER_UI_GLOBAL_ERROR_GLOBAL_ERROR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/global_error_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698