| 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/browser_titlebar.h" | 5 #include "chrome/browser/gtk/browser_titlebar.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 UpdateTitle(); | 184 UpdateTitle(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 // We put the min/max/restore/close buttons in a vbox so they are top aligned | 187 // We put the min/max/restore/close buttons in a vbox so they are top aligned |
| 188 // and don't vertically stretch. | 188 // and don't vertically stretch. |
| 189 titlebar_buttons_box_ = gtk_vbox_new(FALSE, 0); | 189 titlebar_buttons_box_ = gtk_vbox_new(FALSE, 0); |
| 190 GtkWidget* buttons_hbox = gtk_hbox_new(FALSE, 0); | 190 GtkWidget* buttons_hbox = gtk_hbox_new(FALSE, 0); |
| 191 gtk_box_pack_start(GTK_BOX(titlebar_buttons_box_), buttons_hbox, FALSE, | 191 gtk_box_pack_start(GTK_BOX(titlebar_buttons_box_), buttons_hbox, FALSE, |
| 192 FALSE, 0); | 192 FALSE, 0); |
| 193 | 193 |
| 194 close_button_.reset(BuildTitlebarButton(IDR_LINUX_CLOSE, IDR_LINUX_CLOSE_P, | 194 close_button_.reset(BuildTitlebarButton(IDR_CLOSE, IDR_CLOSE_P, IDR_CLOSE_H, |
| 195 IDR_LINUX_CLOSE_H, | |
| 196 buttons_hbox, IDS_XPFRAME_CLOSE_TOOLTIP)); | 195 buttons_hbox, IDS_XPFRAME_CLOSE_TOOLTIP)); |
| 197 restore_button_.reset(BuildTitlebarButton(IDR_RESTORE, IDR_RESTORE_P, | 196 restore_button_.reset(BuildTitlebarButton(IDR_RESTORE, IDR_RESTORE_P, |
| 198 IDR_RESTORE_H, buttons_hbox, | 197 IDR_RESTORE_H, buttons_hbox, |
| 199 IDS_XPFRAME_RESTORE_TOOLTIP)); | 198 IDS_XPFRAME_RESTORE_TOOLTIP)); |
| 200 maximize_button_.reset(BuildTitlebarButton(IDR_MAXIMIZE, IDR_MAXIMIZE_P, | 199 maximize_button_.reset(BuildTitlebarButton(IDR_MAXIMIZE, IDR_MAXIMIZE_P, |
| 201 IDR_MAXIMIZE_H, buttons_hbox, | 200 IDR_MAXIMIZE_H, buttons_hbox, |
| 202 IDS_XPFRAME_MAXIMIZE_TOOLTIP)); | 201 IDS_XPFRAME_MAXIMIZE_TOOLTIP)); |
| 203 minimize_button_.reset(BuildTitlebarButton(IDR_MINIMIZE, IDR_MINIMIZE_P, | 202 minimize_button_.reset(BuildTitlebarButton(IDR_MINIMIZE, IDR_MINIMIZE_P, |
| 204 IDR_MINIMIZE_H, buttons_hbox, | 203 IDR_MINIMIZE_H, buttons_hbox, |
| 205 IDS_XPFRAME_MINIMIZE_TOOLTIP)); | 204 IDS_XPFRAME_MINIMIZE_TOOLTIP)); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 size_t num_frames = frame_strip->width() / frame_size; | 443 size_t num_frames = frame_strip->width() / frame_size; |
| 445 g_throbber_frames = new std::vector<GdkPixbuf*>; | 444 g_throbber_frames = new std::vector<GdkPixbuf*>; |
| 446 | 445 |
| 447 // Make a separate GdkPixbuf for each frame of the animation. | 446 // Make a separate GdkPixbuf for each frame of the animation. |
| 448 for (size_t i = 0; i < num_frames; ++i) { | 447 for (size_t i = 0; i < num_frames; ++i) { |
| 449 SkBitmap frame = skia::ImageOperations::CreateTiledBitmap(*frame_strip, | 448 SkBitmap frame = skia::ImageOperations::CreateTiledBitmap(*frame_strip, |
| 450 i * frame_size, 0, frame_size, frame_size); | 449 i * frame_size, 0, frame_size, frame_size); |
| 451 g_throbber_frames->push_back(gfx::GdkPixbufFromSkBitmap(&frame)); | 450 g_throbber_frames->push_back(gfx::GdkPixbufFromSkBitmap(&frame)); |
| 452 } | 451 } |
| 453 } | 452 } |
| OLD | NEW |