OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "third_party/skia/include/core/SkColor.h" | 38 #include "third_party/skia/include/core/SkColor.h" |
39 #include "third_party/skia/include/core/SkShader.h" | 39 #include "third_party/skia/include/core/SkShader.h" |
40 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
41 #include "ui/gfx/canvas.h" | 41 #include "ui/gfx/canvas.h" |
42 #include "ui/gfx/image/image.h" | 42 #include "ui/gfx/image/image.h" |
43 #include "ui/gfx/rect.h" | 43 #include "ui/gfx/rect.h" |
44 #include "ui/gfx/size.h" | 44 #include "ui/gfx/size.h" |
45 #include "ui/gfx/skbitmap_operations.h" | 45 #include "ui/gfx/skbitmap_operations.h" |
46 #include "ui/gfx/skia_util.h" | 46 #include "ui/gfx/skia_util.h" |
47 #include "ui/views/controls/button/label_button.h" | 47 #include "ui/views/controls/button/label_button.h" |
48 #include "ui/views/controls/button/label_button_border.h" | |
49 #include "ui/views/linux_ui/window_button_order_observer.h" | 48 #include "ui/views/linux_ui/window_button_order_observer.h" |
50 | 49 |
51 #if defined(USE_GCONF) | 50 #if defined(USE_GCONF) |
52 #include "chrome/browser/ui/libgtk2ui/gconf_listener.h" | 51 #include "chrome/browser/ui/libgtk2ui/gconf_listener.h" |
53 #endif | 52 #endif |
54 | 53 |
55 // A minimized port of GtkThemeService into something that can provide colors | 54 // A minimized port of GtkThemeService into something that can provide colors |
56 // and images for aura. | 55 // and images for aura. |
57 // | 56 // |
58 // TODO(erg): There's still a lot that needs ported or done for the first time: | 57 // TODO(erg): There's still a lot that needs ported or done for the first time: |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 DCHECK_EQ(size, bitmap.height()); | 550 DCHECK_EQ(size, bitmap.height()); |
552 gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 551 gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
553 image_skia.MakeThreadSafe(); | 552 image_skia.MakeThreadSafe(); |
554 return gfx::Image(image_skia); | 553 return gfx::Image(image_skia); |
555 } | 554 } |
556 return gfx::Image(); | 555 return gfx::Image(); |
557 } | 556 } |
558 | 557 |
559 scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( | 558 scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( |
560 views::LabelButton* owning_button, | 559 views::LabelButton* owning_button, |
561 scoped_ptr<views::LabelButtonBorder> border) { | 560 scoped_ptr<views::Border> border) { |
562 if (owning_button->GetNativeTheme() != NativeThemeGtk2::instance()) | 561 if (owning_button->GetNativeTheme() != NativeThemeGtk2::instance()) |
563 return border.PassAs<views::Border>(); | 562 return border.Pass(); |
564 | 563 |
565 return scoped_ptr<views::Border>( | 564 return scoped_ptr<views::Border>( |
566 new Gtk2Border(this, owning_button, border.Pass())); | 565 new Gtk2Border(this, owning_button, border.Pass())); |
567 } | 566 } |
568 | 567 |
569 void Gtk2UI::AddWindowButtonOrderObserver( | 568 void Gtk2UI::AddWindowButtonOrderObserver( |
570 views::WindowButtonOrderObserver* observer) { | 569 views::WindowButtonOrderObserver* observer) { |
571 if (!leading_buttons_.empty() || !trailing_buttons_.empty()) { | 570 if (!leading_buttons_.empty() || !trailing_buttons_.empty()) { |
572 observer->OnWindowButtonOrderingChange(leading_buttons_, | 571 observer->OnWindowButtonOrderingChange(leading_buttons_, |
573 trailing_buttons_); | 572 trailing_buttons_); |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 ClearAllThemeData(); | 1367 ClearAllThemeData(); |
1369 LoadGtkValues(); | 1368 LoadGtkValues(); |
1370 NativeThemeGtk2::instance()->NotifyObservers(); | 1369 NativeThemeGtk2::instance()->NotifyObservers(); |
1371 } | 1370 } |
1372 | 1371 |
1373 } // namespace libgtk2ui | 1372 } // namespace libgtk2ui |
1374 | 1373 |
1375 views::LinuxUI* BuildGtk2UI() { | 1374 views::LinuxUI* BuildGtk2UI() { |
1376 return new libgtk2ui::Gtk2UI; | 1375 return new libgtk2ui::Gtk2UI; |
1377 } | 1376 } |
OLD | NEW |