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

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

Issue 941133002: Update global error bubble view's boundary (position and size) after loading elevation icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" 9 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h"
10 #include "ui/views/bubble/bubble_delegate.h" 10 #include "ui/views/bubble/bubble_delegate.h"
11 #include "ui/views/controls/button/button.h" 11 #include "ui/views/controls/button/button.h"
12 12
13 class Browser; 13 class Browser;
14 class ElevationIconSetter; 14 class ElevationIconSetter;
15 class GlobalErrorWithStandardBubble; 15 class GlobalErrorWithStandardBubble;
16 16
17 class GlobalErrorBubbleView : public views::ButtonListener, 17 class GlobalErrorBubbleView
18 public views::BubbleDelegateView, 18 : public views::ButtonListener,
19 public GlobalErrorBubbleViewBase { 19 public views::BubbleDelegateView,
20 public base::SupportsWeakPtr<GlobalErrorBubbleView>,
21 public GlobalErrorBubbleViewBase {
20 public: 22 public:
21 GlobalErrorBubbleView( 23 GlobalErrorBubbleView(
22 views::View* anchor_view, 24 views::View* anchor_view,
23 views::BubbleBorder::Arrow arrow, 25 views::BubbleBorder::Arrow arrow,
24 Browser* browser, 26 Browser* browser,
25 const base::WeakPtr<GlobalErrorWithStandardBubble>& error); 27 const base::WeakPtr<GlobalErrorWithStandardBubble>& error);
26 ~GlobalErrorBubbleView() override; 28 ~GlobalErrorBubbleView() override;
27 29
28 // views::ButtonListener implementation. 30 // views::ButtonListener implementation.
29 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 31 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
30 32
31 // views::WidgetDelegate implementation. 33 // views::WidgetDelegate implementation.
32 void WindowClosing() override; 34 void WindowClosing() override;
33 35
34 // views::BubbleDelegateView implementation. 36 // views::BubbleDelegateView implementation.
35 bool ShouldShowCloseButton() const override; 37 bool ShouldShowCloseButton() const override;
36 38
37 // GlobalErrorBubbleViewBase implementation. 39 // GlobalErrorBubbleViewBase implementation.
38 void CloseBubbleView() override; 40 void CloseBubbleView() override;
39 41
42 // Update bubble bound when needed (for example, after elevation icon is set).
43 void UpdateBound();
44
40 private: 45 private:
41 Browser* browser_; 46 Browser* browser_;
42 base::WeakPtr<GlobalErrorWithStandardBubble> error_; 47 base::WeakPtr<GlobalErrorWithStandardBubble> error_;
43 48
44 scoped_ptr<ElevationIconSetter> elevation_icon_setter_; 49 scoped_ptr<ElevationIconSetter> elevation_icon_setter_;
45 50
46 DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView); 51 DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView);
47 }; 52 };
48 53
49 #endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ 54 #endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698