diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-10 18:05:13 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-10 18:05:13 +0000 |
commit | c30fa32ff166ba04adc796e59dec61466b8ae479 (patch) | |
tree | a1f4838726c4712d8847015b4105a5da05586fae /chrome/browser/ui/views/global_error_bubble_view.h | |
parent | c5219ddac893aafb507d759773fc9d3be7378464 (diff) | |
download | chromium_src-c30fa32ff166ba04adc796e59dec61466b8ae479.zip chromium_src-c30fa32ff166ba04adc796e59dec61466b8ae479.tar.gz chromium_src-c30fa32ff166ba04adc796e59dec61466b8ae479.tar.bz2 |
Add global error bubble view for Views
This change adds a bubble view to show global errors on toolkit Views. Tests comming in a separate CL.
BUG=95146
Review URL: http://codereview.chromium.org/7859025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/global_error_bubble_view.h')
-rw-r--r-- | chrome/browser/ui/views/global_error_bubble_view.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/global_error_bubble_view.h b/chrome/browser/ui/views/global_error_bubble_view.h new file mode 100644 index 0000000..2b17b9e --- /dev/null +++ b/chrome/browser/ui/views/global_error_bubble_view.h @@ -0,0 +1,41 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ +#define CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ +#pragma once + +#include "chrome/browser/ui/views/bubble/bubble.h" +#include "views/controls/button/button.h" + +class Browser; +class GlobalError; + +class GlobalErrorBubbleView : public views::View, + public views::ButtonListener, + public BubbleDelegate { + public: + GlobalErrorBubbleView(Browser* browser, GlobalError* error); + virtual ~GlobalErrorBubbleView(); + + // views::View implementation. + virtual gfx::Size GetPreferredSize() OVERRIDE; + + // views::ButtonListener implementation. + virtual void ButtonPressed(views::Button* sender, + const views::Event& event) OVERRIDE; + + // BubbleDelegate implementation. + virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; + virtual bool CloseOnEscape() OVERRIDE; + virtual bool FadeInOnShow() OVERRIDE; + + private: + Browser* browser_; + GlobalError* error_; + + DISALLOW_COPY_AND_ASSIGN(GlobalErrorBubbleView); +}; + +#endif // CHROME_BROWSER_UI_VIEWS_GLOBAL_ERROR_BUBBLE_VIEW_H_ |