diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-04 04:31:10 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-04 04:31:10 +0000 |
commit | 9900c6f7da1e21d66511fe7c8a44fca9f03a7d88 (patch) | |
tree | 8f6707ca2cdcb7b7326b8e9ec901613047553be0 /ui | |
parent | ee0b101483ec982ca5abb03208ce3fa5ac057a3e (diff) | |
download | chromium_src-9900c6f7da1e21d66511fe7c8a44fca9f03a7d88.zip chromium_src-9900c6f7da1e21d66511fe7c8a44fca9f03a7d88.tar.gz chromium_src-9900c6f7da1e21d66511fe7c8a44fca9f03a7d88.tar.bz2 |
Fix views examples crash by returning appropriate colors from GetSystemColor().
This fixes the following crash:
[0203/175206:FATAL:native_theme_gtk.cc(43)] Check failed: false. Invalid color_id: 4
Backtrace:
base::debug::StackTrace::StackTrace() [0x7f87a16293c6]
logging::LogMessage::~LogMessage() [0x7f87a1656032]
gfx::NativeThemeGtk::GetSystemColor() [0x7f87a1cb7c32]
views::TextButtonBase::TextButtonBase() [0x7f87a1ea1090]
views::TextButton::TextButton() [0x7f87a1ea25ec]
views::examples::TreeViewExample::CreateExampleView() [0x44253b]
views::examples::(anonymous namespace)::ContainerView::ViewHierarchyChanged() [0x449f6a]
views::View::ViewHierarchyChangedImpl() [0x7f87a1f13027]
views::View::PropagateAddNotifications() [0x7f87a1f12e75]
views::View::PropagateAddNotifications() [0x7f87a1f12e40]
views::View::AddChildViewAt() [0x7f87a1f0d375]
views::View::AddChildView() [0x7f87a1f0d09f]
views::GridLayout::AddViewState() [0x7f87a1f04589]
views::GridLayout::AddView() [0x7f87a1f0335b]
views::GridLayout::AddView() [0x7f87a1f03146]
views::GridLayout::AddView() [0x7f87a1f030e9]
views::GridLayout::AddView() [0x7f87a1f02fa2]
views::examples::ExamplesWindowContents::InitExamplesWindow() [0x4370de]
views::examples::ExamplesWindowContents::ViewHierarchyChanged() [0x436cc1]
views::View::ViewHierarchyChangedImpl() [0x7f87a1f13027]
views::View::PropagateAddNotifications() [0x7f87a1f12e75]
views::View::AddChildViewAt() [0x7f87a1f0d375]
views::ClientView::ViewHierarchyChanged() [0x7f87a1f327e4]
views::View::ViewHierarchyChangedImpl() [0x7f87a1f13027]
views::View::PropagateAddNotifications() [0x7f87a1f12e75]
views::View::AddChildViewAt() [0x7f87a1f0d375]
views::NonClientView::ViewHierarchyChanged() [0x7f87a1f38de4]
views::View::ViewHierarchyChangedImpl() [0x7f87a1f13027]
views::View::PropagateAddNotifications() [0x7f87a1f12e75]
views::View::AddChildViewAt() [0x7f87a1f0d375]
views::View::AddChildView() [0x7f87a1f0d09f]
views::internal::RootView::SetContentsView() [0x7f87a1f1cce4]
views::Widget::SetContentsView() [0x7f87a1f2b522]
views::Widget::Init() [0x7f87a1f2b187]
views::Widget::CreateWindowWithParentAndBounds() [0x7f87a1f2ad0a]
views::Widget::CreateWindowWithBounds() [0x7f87a1f2ac93]
views::examples::ShowExamplesWindow() [0x43652b]
main [0x412388]
0x7f879cb6aeff
0x412099
Trace/breakpoint trap
R=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9307091
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/native_theme_gtk.cc | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/ui/gfx/native_theme_gtk.cc b/ui/gfx/native_theme_gtk.cc index de2e524..53d2636 100644 --- a/ui/gfx/native_theme_gtk.cc +++ b/ui/gfx/native_theme_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -14,6 +14,19 @@ namespace { const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); +// Theme colors returned by GetSystemColor(). + +// FocusableBorder: +const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); +const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); + +// TextButton: +const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); +const SkColor kTextButtonEnabledColor = SkColorSetRGB(6, 45, 117); +const SkColor kTextButtonDisabledColor = SkColorSetRGB(161, 161, 146); +const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); +const SkColor kTextButtonHoverColor = kTextButtonEnabledColor; + } // namespace namespace gfx { @@ -39,6 +52,25 @@ SkColor NativeThemeGtk::GetSystemColor(ColorId color_id) const { // chromium-os bug 23461). Need to figure out the right thing and do it. return gfx::GdkColorToSkColor( gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]); + + // FocusableBorder: + case kColorId_FocusedBorderColor: + return kFocusedBorderColor; + case kColorId_UnfocusedBorderColor: + return kUnfocusedBorderColor; + + // TextButton: + case kColorId_TextButtonBackgroundColor: + return kTextButtonBackgroundColor; + case kColorId_TextButtonEnabledColor: + return kTextButtonEnabledColor; + case kColorId_TextButtonDisabledColor: + return kTextButtonDisabledColor; + case kColorId_TextButtonHighlightColor: + return kTextButtonHighlightColor; + case kColorId_TextButtonHoverColor: + return kTextButtonHoverColor; + default: NOTREACHED() << "Invalid color_id: " << color_id; break; |