| 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/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "chrome/browser/themes/theme_service.h" | 13 #include "chrome/browser/themes/theme_service.h" |
| 14 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_frame.h" | 14 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_frame.h" |
| 15 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" | 15 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" |
| 16 #include "chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h" |
| 16 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" | 17 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" |
| 17 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 18 #include "grit/ui_resources.h" | 19 #include "grit/ui_resources.h" |
| 19 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 20 #include "third_party/skia/include/core/SkCanvas.h" | 21 #include "third_party/skia/include/core/SkCanvas.h" |
| 21 #include "third_party/skia/include/core/SkColor.h" | 22 #include "third_party/skia/include/core/SkColor.h" |
| 22 #include "third_party/skia/include/core/SkShader.h" | 23 #include "third_party/skia/include/core/SkShader.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/gfx/canvas.h" | 25 #include "ui/gfx/canvas.h" |
| 25 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 bool Gtk2UI::GetColor(int id, SkColor* color) const { | 324 bool Gtk2UI::GetColor(int id, SkColor* color) const { |
| 324 ColorMap::const_iterator it = colors_.find(id); | 325 ColorMap::const_iterator it = colors_.find(id); |
| 325 if (it != colors_.end()) { | 326 if (it != colors_.end()) { |
| 326 *color = it->second; | 327 *color = it->second; |
| 327 return true; | 328 return true; |
| 328 } | 329 } |
| 329 | 330 |
| 330 return false; | 331 return false; |
| 331 } | 332 } |
| 332 | 333 |
| 334 ui::SelectFileDialog* Gtk2UI::CreateSelectFileDialog( |
| 335 ui::SelectFileDialog::Listener* listener, |
| 336 ui::SelectFilePolicy* policy) const { |
| 337 return SelectFileDialogImpl::Create(listener, policy); |
| 338 } |
| 339 |
| 333 void Gtk2UI::GetScrollbarColors(GdkColor* thumb_active_color, | 340 void Gtk2UI::GetScrollbarColors(GdkColor* thumb_active_color, |
| 334 GdkColor* thumb_inactive_color, | 341 GdkColor* thumb_inactive_color, |
| 335 GdkColor* track_color) { | 342 GdkColor* track_color) { |
| 336 const GdkColor* theme_thumb_active = NULL; | 343 const GdkColor* theme_thumb_active = NULL; |
| 337 const GdkColor* theme_thumb_inactive = NULL; | 344 const GdkColor* theme_thumb_inactive = NULL; |
| 338 const GdkColor* theme_trough_color = NULL; | 345 const GdkColor* theme_trough_color = NULL; |
| 339 gtk_widget_style_get(GTK_WIDGET(fake_frame_), | 346 gtk_widget_style_get(GTK_WIDGET(fake_frame_), |
| 340 "scrollbar-slider-prelight-color", &theme_thumb_active, | 347 "scrollbar-slider-prelight-color", &theme_thumb_active, |
| 341 "scrollbar-slider-normal-color", &theme_thumb_inactive, | 348 "scrollbar-slider-normal-color", &theme_thumb_inactive, |
| 342 "scrollbar-trough-color", &theme_trough_color, | 349 "scrollbar-trough-color", &theme_trough_color, |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 958 |
| 952 void Gtk2UI::ClearAllThemeData() { | 959 void Gtk2UI::ClearAllThemeData() { |
| 953 STLDeleteValues(>k_images_); | 960 STLDeleteValues(>k_images_); |
| 954 } | 961 } |
| 955 | 962 |
| 956 } // namespace libgtk2ui | 963 } // namespace libgtk2ui |
| 957 | 964 |
| 958 ui::LinuxUI* BuildGtk2UI() { | 965 ui::LinuxUI* BuildGtk2UI() { |
| 959 return new libgtk2ui::Gtk2UI; | 966 return new libgtk2ui::Gtk2UI; |
| 960 } | 967 } |
| OLD | NEW |