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

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

Issue 1846033002: Switch GlobalErrorBubbleView to a BubbleDialogDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" 10 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h"
11 #include "ui/views/bubble/bubble_delegate.h" 11 #include "ui/views/bubble/bubble_dialog_delegate.h"
12 #include "ui/views/controls/button/button.h" 12 #include "ui/views/controls/button/button.h"
13 13
14 class Browser; 14 class Browser;
15 class ElevationIconSetter; 15 class ElevationIconSetter;
16 class GlobalErrorWithStandardBubble; 16 class GlobalErrorWithStandardBubble;
17 17
18 class GlobalErrorBubbleView : public views::ButtonListener, 18 class GlobalErrorBubbleView : public views::BubbleDialogDelegateView,
19 public views::BubbleDelegateView,
20 public GlobalErrorBubbleViewBase { 19 public GlobalErrorBubbleViewBase {
21 public: 20 public:
22 GlobalErrorBubbleView( 21 GlobalErrorBubbleView(
23 views::View* anchor_view, 22 views::View* anchor_view,
24 views::BubbleBorder::Arrow arrow, 23 views::BubbleBorder::Arrow arrow,
25 Browser* browser, 24 Browser* browser,
26 const base::WeakPtr<GlobalErrorWithStandardBubble>& error); 25 const base::WeakPtr<GlobalErrorWithStandardBubble>& error);
27 ~GlobalErrorBubbleView() override; 26 ~GlobalErrorBubbleView() override;
28 27
29 // views::ButtonListener implementation.
30 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
31
32 // views::WidgetDelegate implementation. 28 // views::WidgetDelegate implementation.
33 base::string16 GetWindowTitle() const override; 29 base::string16 GetWindowTitle() const override;
34 gfx::ImageSkia GetWindowIcon() override; 30 gfx::ImageSkia GetWindowIcon() override;
35 bool ShouldShowWindowIcon() const override; 31 bool ShouldShowWindowIcon() const override;
36 void WindowClosing() override; 32 void WindowClosing() override;
37 33
38 // views::BubbleDelegateView implementation. 34 // views::BubbleDialogDelegateView implementation.
35 void Init() override;
39 bool ShouldShowCloseButton() const override; 36 bool ShouldShowCloseButton() const override;
37 void UpdateButton(views::LabelButton* button, ui::DialogButton type) override;
38 bool ShouldDefaultButtonBeBlue() const override;
39 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
40 int GetDialogButtons() const override;
41 bool Cancel() override;
42 bool Accept() override;
43 bool Close() override;
40 44
41 // GlobalErrorBubbleViewBase implementation. 45 // GlobalErrorBubbleViewBase implementation.
42 void CloseBubbleView() override; 46 void CloseBubbleView() override;
43 47
44 private: 48 private:
45 Browser* browser_; 49 Browser* browser_;
46 base::WeakPtr<GlobalErrorWithStandardBubble> error_; 50 base::WeakPtr<GlobalErrorWithStandardBubble> error_;
47 51
48 scoped_ptr<ElevationIconSetter> elevation_icon_setter_; 52 scoped_ptr<ElevationIconSetter> elevation_icon_setter_;
49 53
50 DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView); 54 DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView);
51 }; 55 };
52 56
53 #endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ 57 #endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_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