Skip to content

Commit

Permalink
ui: Make native_theme its own library.
Browse files Browse the repository at this point in the history
BUG=103304
R=sky@chromium.org


Review URL: https://chromiumcodereview.appspot.com/11275322

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168194 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Nov 16, 2012
1 parent 8d0f901 commit 990e622
Show file tree
Hide file tree
Showing 68 changed files with 4,595 additions and 88 deletions.
6 changes: 3 additions & 3 deletions chrome/browser/ui/views/location_bar/location_bar_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "chrome/browser/ui/search/search_types.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/browser_dialogs.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_prompt_view.h"
#include "chrome/browser/ui/views/browser_dialogs.h"
#include "chrome/browser/ui/views/extensions/extension_popup.h"
#include "chrome/browser/ui/views/location_bar/action_box_button_view.h"
#include "chrome/browser/ui/views/location_bar/content_setting_image_view.h"
Expand Down Expand Up @@ -79,7 +79,7 @@
#include "ui/views/widget/widget.h"

#if defined(OS_WIN)
#include "ui/base/native_theme/native_theme_win.h"
#include "ui/native_theme/native_theme_win.h"
#endif

#if defined(OS_WIN) && !defined(USE_AURA)
Expand All @@ -88,7 +88,7 @@

#if !defined(OS_CHROMEOS)
#include "chrome/browser/ui/views/first_run_bubble.h"
#include "ui/base/native_theme/native_theme.h"
#include "ui/native_theme/native_theme.h"
#endif

#if defined(USE_AURA)
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/ui/views/omnibox/omnibox_result_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/render_text.h"
#include "ui/native_theme/native_theme.h"

#if defined(OS_WIN)
#include "ui/base/native_theme/native_theme_win.h"
#include "ui/native_theme/native_theme_win.h"
#endif

#if defined(USE_AURA)
#include "ui/base/native_theme/native_theme_aura.h"
#include "ui/native_theme/native_theme_aura.h"
#endif

namespace {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/status_bubble_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
#include "third_party/skia/include/core/SkRect.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/linear_animation.h"
#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/point.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/skia_util.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/scrollbar/native_scroll_bar.h"
#include "ui/views/widget/root_view.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/toolbar_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@

#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/base/native_theme/native_theme_aura.h"
#include "ui/compositor/layer.h"
#include "ui/native_theme/native_theme_aura.h"
#endif

using content::UserMetricsAction;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/wrench_menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include "ui/views/widget/widget.h"

#if defined(USE_AURA)
#include "ui/base/native_theme/native_theme_aura.h"
#include "ui/native_theme/native_theme_aura.h"
#endif

using content::HostZoomMap;
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_browser_ui.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'../third_party/libxml/libxml.gyp:libxml',
'../third_party/zlib/zlib.gyp:zlib',
'../ui/base/strings/ui_strings.gyp:ui_strings',
'../ui/native_theme/native_theme.gyp:native_theme',
'../ui/ui.gyp:ui',
'../ui/ui.gyp:ui_resources',
'../webkit/support/webkit_support.gyp:user_agent',
Expand Down
1 change: 1 addition & 0 deletions content/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ include_rules = [
"+ui/compositor",
"+ui/gfx",
"+ui/gl",
"+ui/native_theme",
"+ui/surface",
# Content knows about grd files, but the specifics of how to get a resource
# given its id is left to the embedder.
Expand Down
1 change: 1 addition & 0 deletions content/content_renderer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'../third_party/libjingle/libjingle.gyp:libjingle',
'../third_party/npapi/npapi.gyp:npapi',
'<(webkit_src_dir)/Source/WebKit/chromium/WebKit.gyp:webkit',
'../ui/native_theme/native_theme.gyp:native_theme',
'../ui/surface/surface.gyp:surface',
'../v8/tools/gyp/v8.gyp:v8',
'../webkit/support/webkit_support.gyp:glue',
Expand Down
4 changes: 2 additions & 2 deletions content/renderer/render_view_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@
#elif defined(OS_WIN)
// TODO(port): these files are currently Windows only because they concern:
// * theming
#include "ui/base/native_theme/native_theme_win.h"
#include "ui/native_theme/native_theme_win.h"
#elif defined(USE_X11)
#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme.h"
#include "ui/base/native_theme/native_theme.h"
#include "ui/native_theme/native_theme.h"
#elif defined(OS_MACOSX)
#include "skia/ext/skia_utils_mac.h"
#endif
Expand Down
26 changes: 26 additions & 0 deletions ui/native_theme/native_theme.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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/native_theme/native_theme.h"

namespace ui {

NativeTheme::NativeTheme()
: thumb_inactive_color_(0xeaeaea),
thumb_active_color_(0xf4f4f4),
track_color_(0xd3d3d3) {
}

void NativeTheme::SetScrollbarColors(unsigned inactive_color,
unsigned active_color,
unsigned track_color) {
thumb_inactive_color_ = inactive_color;
thumb_active_color_ = active_color;
track_color_ = track_color;
}

// NativeTheme::instance() is implemented in the platform specific source files,
// such as native_theme_win.cc or native_theme_linux.cc

} // namespace ui
39 changes: 39 additions & 0 deletions ui/native_theme/native_theme.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.

{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'native_theme',
'type': '<(component)',
'dependencies': [
'../../base/base.gyp:base',
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../../skia/skia.gyp:skia',
'../ui.gyp:ui',
'../ui.gyp:ui_resources',
],
'defines': [
'NATIVE_THEME_IMPLEMENTATION',
],
'sources': [
'native_theme.cc',
'native_theme.h',
'native_theme_android.cc',
'native_theme_android.h',
'native_theme_aura.cc',
'native_theme_aura.h',
'native_theme_base.cc',
'native_theme_base.h',
'native_theme_gtk.cc',
'native_theme_gtk.h',
'native_theme_win.cc',
'native_theme_win.h',
],
},
],
}
Loading

0 comments on commit 990e622

Please sign in to comment.