Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: trunk/src/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc

Issue 276773004: Revert 269892 "linux_aura: Compile ash into chrome." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc
===================================================================
--- trunk/src/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc (revision 269901)
+++ trunk/src/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc (working copy)
@@ -4,78 +4,16 @@
#include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h"
-#include "chrome/browser/themes/theme_service.h"
-#include "chrome/browser/themes/theme_service_factory.h"
-#include "chrome/browser/ui/views/frame/browser_frame.h"
-#include "chrome/browser/ui/views/frame/browser_view.h"
-#include "chrome/browser/ui/views/theme_image_mapper.h"
-
-namespace {
-
-// DesktopThemeProvider maps resource ids using MapThemeImage(). This is
-// necessary for BrowserDesktopWindowTreeHostWin so that it uses the windows
-// theme images rather than the ash theme images.
-//
-// This differs from the version in browser_desktop_window_tree_host_win.cc
-// because we need to also look up whether we're using the native theme.
-class DesktopThemeProvider : public ui::ThemeProvider {
- public:
- explicit DesktopThemeProvider(ThemeService* delegate)
- : delegate_(delegate) {
- }
-
- virtual bool UsingNativeTheme() const OVERRIDE {
- return delegate_->UsingNativeTheme();
- }
- virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE {
- if (delegate_->UsingNativeTheme())
- return delegate_->GetImageSkiaNamed(id);
-
- return delegate_->GetImageSkiaNamed(
- chrome::MapThemeImage(chrome::HOST_DESKTOP_TYPE_NATIVE, id));
- }
- virtual SkColor GetColor(int id) const OVERRIDE {
- return delegate_->GetColor(id);
- }
- virtual int GetDisplayProperty(int id) const OVERRIDE {
- return delegate_->GetDisplayProperty(id);
- }
- virtual bool ShouldUseNativeFrame() const OVERRIDE {
- return delegate_->ShouldUseNativeFrame();
- }
- virtual bool HasCustomImage(int id) const OVERRIDE {
- return delegate_->HasCustomImage(
- chrome::MapThemeImage(chrome::HOST_DESKTOP_TYPE_NATIVE, id));
- }
- virtual base::RefCountedMemory* GetRawData(
- int id,
- ui::ScaleFactor scale_factor) const OVERRIDE {
- return delegate_->GetRawData(id, scale_factor);
- }
-
- private:
- ThemeService* delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(DesktopThemeProvider);
-};
-
-} // namespace
-
////////////////////////////////////////////////////////////////////////////////
// BrowserDesktopWindowTreeHostX11, public:
BrowserDesktopWindowTreeHostX11::BrowserDesktopWindowTreeHostX11(
views::internal::NativeWidgetDelegate* native_widget_delegate,
views::DesktopNativeWidgetAura* desktop_native_widget_aura,
- BrowserView* browser_view,
- BrowserFrame* browser_frame)
+ BrowserView* browser_view)
: DesktopWindowTreeHostX11(native_widget_delegate,
desktop_native_widget_aura),
browser_view_(browser_view) {
- scoped_ptr<ui::ThemeProvider> theme_provider(
- new DesktopThemeProvider(ThemeServiceFactory::GetForProfile(
- browser_view->browser()->profile())));
- browser_frame->SetThemeProvider(theme_provider.Pass());
}
BrowserDesktopWindowTreeHostX11::~BrowserDesktopWindowTreeHostX11() {
@@ -129,6 +67,5 @@
BrowserFrame* browser_frame) {
return new BrowserDesktopWindowTreeHostX11(native_widget_delegate,
desktop_native_widget_aura,
- browser_view,
- browser_frame);
+ browser_view);
}

Powered by Google App Engine
This is Rietveld 408576698