| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/extension_shelf_gtk.h" | 5 #include "chrome/browser/gtk/extension_shelf_gtk.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/gtk/browser_window_gtk.h" | 8 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 9 #include "chrome/browser/gtk/gtk_theme_provider.h" | 9 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 10 #include "chrome/browser/gtk/nine_box.h" | 10 #include "chrome/browser/gtk/nine_box.h" |
| 11 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profile.h" |
| 12 #include "chrome/common/notification_service.h" | 12 #include "chrome/common/notification_service.h" |
| 13 #include "grit/app_resources.h" | 13 #include "grit/app_resources.h" |
| 14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 15 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
| 16 | 16 |
| 17 // Preferred height of the ExtensionShelfGtk. | 17 // Preferred height of the ExtensionShelfGtk. |
| 18 static const int kShelfHeight = 29; | 18 static const int kShelfHeight = 29; |
| 19 | 19 |
| 20 static const int kToolstripPadding = 2; | 20 static const int kToolstripPadding = 2; |
| 21 | 21 |
| 22 class ExtensionShelfGtk::Toolstrip { | 22 class ExtensionShelfGtk::Toolstrip { |
| 23 public: | 23 public: |
| 24 explicit Toolstrip(ExtensionHost* host) | 24 explicit Toolstrip(ExtensionHost* host) |
| 25 : host_(host), | 25 : host_(host), |
| 26 extension_name_(host_->extension()->name()) { | 26 extension_name_(host_->extension()->name()) { |
| 27 DCHECK(host_->view()); |
| 27 Init(); | 28 Init(); |
| 28 } | 29 } |
| 29 | 30 |
| 30 ~Toolstrip() { | 31 ~Toolstrip() { |
| 31 label_.Destroy(); | 32 label_.Destroy(); |
| 32 } | 33 } |
| 33 | 34 |
| 34 void AddToolstripToBox(GtkWidget* box); | 35 void AddToolstripToBox(GtkWidget* box); |
| 35 void RemoveToolstripFromBox(GtkWidget* box); | 36 void RemoveToolstripFromBox(GtkWidget* box); |
| 36 | 37 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 event->area.width, event->area.height); | 205 event->area.width, event->area.height); |
| 205 cairo_clip(cr); | 206 cairo_clip(cr); |
| 206 bar->InitBackground(); | 207 bar->InitBackground(); |
| 207 bar->background_ninebox_->RenderTopCenterStrip( | 208 bar->background_ninebox_->RenderTopCenterStrip( |
| 208 cr, event->area.x, event->area.y, | 209 cr, event->area.x, event->area.y, |
| 209 event->area.x + event->area.width); | 210 event->area.x + event->area.width); |
| 210 cairo_destroy(cr); | 211 cairo_destroy(cr); |
| 211 | 212 |
| 212 return FALSE; // Propagate expose to children. | 213 return FALSE; // Propagate expose to children. |
| 213 } | 214 } |
| OLD | NEW |