| 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/gtk/find_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/find_bar_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 kEntryPaddingLeft, kBarPaddingRight); | 241 kEntryPaddingLeft, kBarPaddingRight); |
| 242 gtk_widget_set_size_request(container_, kFindBarWidth, kFindBarHeight); | 242 gtk_widget_set_size_request(container_, kFindBarWidth, kFindBarHeight); |
| 243 ViewIDUtil::SetID(container_, VIEW_ID_FIND_IN_PAGE); | 243 ViewIDUtil::SetID(container_, VIEW_ID_FIND_IN_PAGE); |
| 244 gtk_widget_set_app_paintable(container_, TRUE); | 244 gtk_widget_set_app_paintable(container_, TRUE); |
| 245 | 245 |
| 246 slide_widget_.reset(new SlideAnimatorGtk(container_, | 246 slide_widget_.reset(new SlideAnimatorGtk(container_, |
| 247 SlideAnimatorGtk::DOWN, | 247 SlideAnimatorGtk::DOWN, |
| 248 0, false, true, NULL)); | 248 0, false, true, NULL)); |
| 249 | 249 |
| 250 GtkWidget* close_alignment = gtk_alignment_new(0, 0.6, 1, 0); | 250 GtkWidget* close_alignment = gtk_alignment_new(0, 0.6, 1, 0); |
| 251 close_button_.reset(new CustomDrawButton( | 251 close_button_.reset(CustomDrawButton::CloseButtonBar(theme_service_)); |
| 252 theme_service_, IDR_TAB_CLOSE, | |
| 253 IDR_TAB_CLOSE_P, IDR_TAB_CLOSE_H, IDR_TAB_CLOSE, | |
| 254 GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU)); | |
| 255 gtk_container_add(GTK_CONTAINER(close_alignment), close_button_->widget()); | 252 gtk_container_add(GTK_CONTAINER(close_alignment), close_button_->widget()); |
| 256 gtk_box_pack_end(GTK_BOX(hbox), close_alignment, FALSE, FALSE, | 253 gtk_box_pack_end(GTK_BOX(hbox), close_alignment, FALSE, FALSE, |
| 257 kCloseButtonPadding); | 254 kCloseButtonPadding); |
| 258 g_signal_connect(close_button_->widget(), "clicked", | 255 g_signal_connect(close_button_->widget(), "clicked", |
| 259 G_CALLBACK(OnClickedThunk), this); | 256 G_CALLBACK(OnClickedThunk), this); |
| 260 gtk_widget_set_tooltip_text(close_button_->widget(), | 257 gtk_widget_set_tooltip_text(close_button_->widget(), |
| 261 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str()); | 258 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str()); |
| 262 | 259 |
| 263 find_next_button_.reset(new CustomDrawButton(theme_service_, | 260 find_next_button_.reset(new CustomDrawButton(theme_service_, |
| 264 IDR_FINDINPAGE_NEXT, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, | 261 IDR_FINDINPAGE_NEXT, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 // because we also need it to take up space). | 551 // because we also need it to take up space). |
| 555 gtk_event_box_set_visible_window(GTK_EVENT_BOX(border_bin_), FALSE); | 552 gtk_event_box_set_visible_window(GTK_EVENT_BOX(border_bin_), FALSE); |
| 556 gtk_widget_set_app_paintable(border_bin_, FALSE); | 553 gtk_widget_set_app_paintable(border_bin_, FALSE); |
| 557 | 554 |
| 558 gtk_misc_set_alignment(GTK_MISC(match_count_label_), 0.5, 1.0); | 555 gtk_misc_set_alignment(GTK_MISC(match_count_label_), 0.5, 1.0); |
| 559 | 556 |
| 560 // This is necessary to make the close button dark enough. | 557 // This is necessary to make the close button dark enough. |
| 561 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 558 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 562 close_button_->SetBackground( | 559 close_button_->SetBackground( |
| 563 theme_service_->GetColor(ThemeProperties::COLOR_TAB_TEXT), | 560 theme_service_->GetColor(ThemeProperties::COLOR_TAB_TEXT), |
| 564 rb.GetImageNamed(IDR_TAB_CLOSE).AsBitmap(), | 561 rb.GetImageNamed(IDR_CLOSE_1).AsBitmap(), |
| 565 rb.GetImageNamed(IDR_TAB_CLOSE).AsBitmap()); | 562 rb.GetImageNamed(IDR_CLOSE_1).AsBitmap()); |
| 566 } | 563 } |
| 567 | 564 |
| 568 UpdateMatchLabelAppearance(match_label_failure_); | 565 UpdateMatchLabelAppearance(match_label_failure_); |
| 569 } | 566 } |
| 570 | 567 |
| 571 bool FindBarGtk::GetFindBarWindowInfo(gfx::Point* position, | 568 bool FindBarGtk::GetFindBarWindowInfo(gfx::Point* position, |
| 572 bool* fully_visible) { | 569 bool* fully_visible) { |
| 573 if (position) | 570 if (position) |
| 574 *position = GetPosition(); | 571 *position = GetPosition(); |
| 575 | 572 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); | 1045 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); |
| 1049 string16 text; | 1046 string16 text; |
| 1050 clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &text); | 1047 clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &text); |
| 1051 | 1048 |
| 1052 // Overwrite clipboard with the correct source tag. | 1049 // Overwrite clipboard with the correct source tag. |
| 1053 ui::ScopedClipboardWriter scw(clipboard, | 1050 ui::ScopedClipboardWriter scw(clipboard, |
| 1054 ui::Clipboard::BUFFER_STANDARD, | 1051 ui::Clipboard::BUFFER_STANDARD, |
| 1055 source_tag); | 1052 source_tag); |
| 1056 scw.WriteText(text); | 1053 scw.WriteText(text); |
| 1057 } | 1054 } |
| OLD | NEW |