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_CLOSE, IDR_CLOSE_P, IDR_CLOSE_H, | 194 if (CommandLine::ForCurrentProcess()->HasSwitch(L"glen")) { |
195 buttons_hbox, IDS_XPFRAME_CLOSE_TOOLTIP)); | 195 close_button_.reset(BuildTitlebarButton(IDR_GLEN, IDR_GLEN, IDR_GLEN, |
| 196 buttons_hbox, IDS_GLEN)); |
| 197 } else { |
| 198 close_button_.reset(BuildTitlebarButton(IDR_CLOSE, IDR_CLOSE_P, IDR_CLOSE_H, |
| 199 buttons_hbox, |
| 200 IDS_XPFRAME_CLOSE_TOOLTIP)); |
| 201 } |
| 202 |
196 restore_button_.reset(BuildTitlebarButton(IDR_RESTORE, IDR_RESTORE_P, | 203 restore_button_.reset(BuildTitlebarButton(IDR_RESTORE, IDR_RESTORE_P, |
197 IDR_RESTORE_H, buttons_hbox, | 204 IDR_RESTORE_H, buttons_hbox, |
198 IDS_XPFRAME_RESTORE_TOOLTIP)); | 205 IDS_XPFRAME_RESTORE_TOOLTIP)); |
199 maximize_button_.reset(BuildTitlebarButton(IDR_MAXIMIZE, IDR_MAXIMIZE_P, | 206 maximize_button_.reset(BuildTitlebarButton(IDR_MAXIMIZE, IDR_MAXIMIZE_P, |
200 IDR_MAXIMIZE_H, buttons_hbox, | 207 IDR_MAXIMIZE_H, buttons_hbox, |
201 IDS_XPFRAME_MAXIMIZE_TOOLTIP)); | 208 IDS_XPFRAME_MAXIMIZE_TOOLTIP)); |
202 minimize_button_.reset(BuildTitlebarButton(IDR_MINIMIZE, IDR_MINIMIZE_P, | 209 minimize_button_.reset(BuildTitlebarButton(IDR_MINIMIZE, IDR_MINIMIZE_P, |
203 IDR_MINIMIZE_H, buttons_hbox, | 210 IDR_MINIMIZE_H, buttons_hbox, |
204 IDS_XPFRAME_MINIMIZE_TOOLTIP)); | 211 IDS_XPFRAME_MINIMIZE_TOOLTIP)); |
205 | 212 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 size_t num_frames = frame_strip->width() / frame_size; | 450 size_t num_frames = frame_strip->width() / frame_size; |
444 g_throbber_frames = new std::vector<GdkPixbuf*>; | 451 g_throbber_frames = new std::vector<GdkPixbuf*>; |
445 | 452 |
446 // Make a separate GdkPixbuf for each frame of the animation. | 453 // Make a separate GdkPixbuf for each frame of the animation. |
447 for (size_t i = 0; i < num_frames; ++i) { | 454 for (size_t i = 0; i < num_frames; ++i) { |
448 SkBitmap frame = skia::ImageOperations::CreateTiledBitmap(*frame_strip, | 455 SkBitmap frame = skia::ImageOperations::CreateTiledBitmap(*frame_strip, |
449 i * frame_size, 0, frame_size, frame_size); | 456 i * frame_size, 0, frame_size, frame_size); |
450 g_throbber_frames->push_back(gfx::GdkPixbufFromSkBitmap(&frame)); | 457 g_throbber_frames->push_back(gfx::GdkPixbufFromSkBitmap(&frame)); |
451 } | 458 } |
452 } | 459 } |
OLD | NEW |