diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-05 17:19:52 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-05 17:19:52 +0000 |
commit | e83874fb14a7d4dfb187b197b84471fb9be4b5ec (patch) | |
tree | 8f86ce2ec4e62defd4e548186dc10e690d679468 | |
parent | 9557a5aa780d308c523cdd84377d71efbb325f63 (diff) | |
download | chromium_src-e83874fb14a7d4dfb187b197b84471fb9be4b5ec.zip chromium_src-e83874fb14a7d4dfb187b197b84471fb9be4b5ec.tar.gz chromium_src-e83874fb14a7d4dfb187b197b84471fb9be4b5ec.tar.bz2 |
Extract the last SkColor from ResourceBundle API.
NOTE: This was a TODO for ben@.
R=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9602003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124953 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/constrained_window_views.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc | 5 | ||||
-rw-r--r-- | ui/base/resource/resource_bundle.cc | 4 | ||||
-rw-r--r-- | ui/base/resource/resource_bundle.h | 6 | ||||
-rw-r--r-- | ui/views/color_constants.cc | 11 | ||||
-rw-r--r-- | ui/views/color_constants.h | 18 | ||||
-rw-r--r-- | ui/views/views.gyp | 2 | ||||
-rw-r--r-- | ui/views/window/custom_frame_view.cc | 9 |
8 files changed, 43 insertions, 18 deletions
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc index 2a8b4cf..162a658 100644 --- a/chrome/browser/ui/views/constrained_window_views.cc +++ b/chrome/browser/ui/views/constrained_window_views.cc @@ -32,6 +32,7 @@ #include "ui/gfx/path.h" #include "ui/gfx/rect.h" #include "ui/gfx/screen.h" +#include "ui/views/color_constants.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/views_delegate.h" @@ -272,7 +273,8 @@ const int kTitleLeftSpacing = 2; const int kTitleCaptionSpacing = 5; const SkColor kContentsBorderShadow = SkColorSetARGB(51, 0, 0, 0); -} + +} // namespace //////////////////////////////////////////////////////////////////////////////// // ConstrainedWindowFrameView, public: @@ -487,7 +489,7 @@ void ConstrainedWindowFrameView::PaintClientEdge(gfx::Canvas* canvas) { frame_shadow_bounds.Inset(-kFrameShadowThickness, -kFrameShadowThickness); canvas->FillRect(frame_shadow_bounds, kContentsBorderShadow); - canvas->FillRect(client_edge_bounds, ResourceBundle::toolbar_color); + canvas->FillRect(client_edge_bounds, views::kClientEdgeColor); } void ConstrainedWindowFrameView::LayoutWindowControls() { diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc index 4226f7a9a..4a90c7e 100644 --- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc @@ -20,6 +20,7 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/path.h" +#include "ui/views/color_constants.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -454,13 +455,13 @@ void AppPanelBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), client_area_top, left->width(), client_area_height); - // Draw the toolbar color to fill in the edges. + // Draw the color to fill in the edges. canvas->DrawRect(gfx::Rect( client_area_bounds.x() - kClientEdgeThickness, client_area_top - kClientEdgeThickness, client_area_bounds.width() + kClientEdgeThickness, client_area_bottom - client_area_top + kClientEdgeThickness), - ResourceBundle::toolbar_color); + views::kClientEdgeColor); } void AppPanelBrowserFrameView::LayoutWindowControls() { diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc index d0ad99f..e2dbaa3 100644 --- a/ui/base/resource/resource_bundle.cc +++ b/ui/base/resource/resource_bundle.cc @@ -44,10 +44,6 @@ const int kLargeFontSizeDelta = 8; ResourceBundle* ResourceBundle::g_shared_instance_ = NULL; // static -const SkColor ResourceBundle::toolbar_color = - SkColorSetRGB(210, 225, 246); - -// static std::string ResourceBundle::InitSharedInstanceWithLocale( const std::string& pref_locale) { DCHECK(g_shared_instance_ == NULL) << "ResourceBundle initialized twice"; diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h index d8f5119..fdd8934 100644 --- a/ui/base/resource/resource_bundle.h +++ b/ui/base/resource/resource_bundle.h @@ -27,9 +27,6 @@ #include "ui/gfx/native_widget_types.h" class SkBitmap; -// Don't use uint32 or uint32_t here because Eclipse's indexer gets confused. -// This can be removed when the static colors are moved to ThemeProvider. -typedef unsigned int SkColor; namespace base { class Lock; @@ -191,9 +188,6 @@ class UI_EXPORT ResourceBundle { public: #endif - // TODO(beng): These browser-specific concepts should move to ThemeProvider. - static const SkColor toolbar_color; - private: FRIEND_TEST_ALL_PREFIXES(ResourceBundle, LoadDataResourceBytes); diff --git a/ui/views/color_constants.cc b/ui/views/color_constants.cc new file mode 100644 index 0000000..07a6ecb --- /dev/null +++ b/ui/views/color_constants.cc @@ -0,0 +1,11 @@ +// 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. + +#include "ui/views/color_constants.h" + +namespace views { + +const SkColor kClientEdgeColor = SkColorSetRGB(210, 225, 246); + +} // namespace views diff --git a/ui/views/color_constants.h b/ui/views/color_constants.h new file mode 100644 index 0000000..c39f476 --- /dev/null +++ b/ui/views/color_constants.h @@ -0,0 +1,18 @@ +// 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. + +#ifndef UI_VIEWS_COLOR_CONSTANTS_H_ +#define UI_VIEWS_COLOR_CONSTANTS_H_ +#pragma once + +#include "third_party/skia/include/core/SkColor.h" +#include "ui/views/views_export.h" + +namespace views { + +VIEWS_EXPORT extern const SkColor kClientEdgeColor; + +} // namespace views + +#endif // UI_VIEWS_COLOR_CONSTANTS_H_ diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 9e5f756..68da3d9 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -65,6 +65,8 @@ 'bubble/bubble_frame_view.h', 'button_drag_utils.cc', 'button_drag_utils.h', + 'color_constants.cc', + 'color_constants.h', 'context_menu_controller.h', 'controls/button/button.cc', 'controls/button/button.h', diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index dc3a4b2..f603182 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.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. @@ -15,6 +15,7 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/path.h" +#include "ui/views/color_constants.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/client_view.h" #include "ui/views/window/frame_background.h" @@ -433,10 +434,10 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), client_area_top, left->width(), client_area_height); - // Draw the toolbar color to fill in the edges. + // Draw the color to fill in the edges. canvas->DrawRect(gfx::Rect(client_area_bounds.x() - 1, client_area_top - 1, client_area_bounds.width() + 1, client_area_bottom - client_area_top + 1), - ui::ResourceBundle::toolbar_color); + kClientEdgeColor); } SkColor CustomFrameView::GetFrameColor() const { @@ -444,7 +445,7 @@ SkColor CustomFrameView::GetFrameColor() const { } SkBitmap* CustomFrameView::GetFrameBitmap() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( + return ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( frame_->IsActive() ? IDR_FRAME : IDR_FRAME_INACTIVE); } |