diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 07:35:32 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 07:35:32 +0000 |
commit | 213dac2f0bff9162502fe325b6ebb85a255efcb2 (patch) | |
tree | 3640cb1f19976e38677b8632537d2d41f8444d0f /chrome/browser/ui/views/sad_tab_view.h | |
parent | 6de53d401aa8dc6c7e0a9874c71a95ce88ade50d (diff) | |
download | chromium_src-213dac2f0bff9162502fe325b6ebb85a255efcb2.zip chromium_src-213dac2f0bff9162502fe325b6ebb85a255efcb2.tar.gz chromium_src-213dac2f0bff9162502fe325b6ebb85a255efcb2.tar.bz2 |
Move browser/views to browser/ui/views
TBR=brettw
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4694005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/sad_tab_view.h')
-rw-r--r-- | chrome/browser/ui/views/sad_tab_view.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/sad_tab_view.h b/chrome/browser/ui/views/sad_tab_view.h new file mode 100644 index 0000000..22c088a --- /dev/null +++ b/chrome/browser/ui/views/sad_tab_view.h @@ -0,0 +1,62 @@ +// Copyright (c) 2006-2008 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_SAD_TAB_VIEW_H_ +#define CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H_ +#pragma once + +#include "base/basictypes.h" +#include "gfx/font.h" +#include "views/controls/link.h" +#include "views/view.h" + +class SkBitmap; +class TabContents; + +/////////////////////////////////////////////////////////////////////////////// +// +// SadTabView +// +// A views::View subclass used to render the presentation of the crashed +// "sad tab" in the browser window when a renderer is destroyed unnaturally. +// +/////////////////////////////////////////////////////////////////////////////// +class SadTabView : public views::View, + public views::LinkController { + public: + explicit SadTabView(TabContents* tab_contents); + virtual ~SadTabView() {} + + // Overridden from views::View: + virtual void Paint(gfx::Canvas* canvas); + virtual void Layout(); + + // Overridden from views::LinkController: + virtual void LinkActivated(views::Link* source, int event_flags); + + private: + static void InitClass(); + + // Assorted resources for display. + static SkBitmap* sad_tab_bitmap_; + static gfx::Font* title_font_; + static gfx::Font* message_font_; + static std::wstring title_; + static std::wstring message_; + static int title_width_; + + TabContents* tab_contents_; + views::Link* learn_more_link_; + + // Regions within the display for different components, populated by + // Layout(). + gfx::Rect icon_bounds_; + gfx::Rect title_bounds_; + gfx::Rect message_bounds_; + gfx::Rect link_bounds_; + + DISALLOW_COPY_AND_ASSIGN(SadTabView); +}; + +#endif // CHROME_BROWSER_UI_VIEWS_SAD_TAB_VIEW_H__ |