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/bookmark_manager_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_manager_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/gtk_dnd_util.h" | 10 #include "app/gtk_dnd_util.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 int width = std::max(1, right - left); | 600 int width = std::max(1, right - left); |
601 int height = std::max(1, bottom - top); | 601 int height = std::max(1, bottom - top); |
602 gtk_window_resize(GTK_WINDOW(window_), width, height); | 602 gtk_window_resize(GTK_WINDOW(window_), width, height); |
603 return; | 603 return; |
604 } | 604 } |
605 } | 605 } |
606 | 606 |
607 // Otherwise, just set a default size (GTK will override this if it's not | 607 // Otherwise, just set a default size (GTK will override this if it's not |
608 // large enough to hold the window's contents). | 608 // large enough to hold the window's contents). |
609 gtk_widget_realize(window_); | 609 gtk_widget_realize(window_); |
610 int width = 1, height = 1; | 610 gtk_util::SetWindowSizeFromResources( |
611 gtk_util::GetWidgetSizeFromResources( | 611 GTK_WINDOW(window_), |
612 window_, | |
613 IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS, | 612 IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS, |
614 IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES, | 613 IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES, |
615 &width, &height); | 614 true); |
616 gtk_window_set_default_size(GTK_WINDOW(window_), width, height); | |
617 } | 615 } |
618 | 616 |
619 void BookmarkManagerGtk::ResetOrganizeMenu(bool left) { | 617 void BookmarkManagerGtk::ResetOrganizeMenu(bool left) { |
620 organize_is_for_left_ = left; | 618 organize_is_for_left_ = left; |
621 const BookmarkNode* parent = GetFolder(); | 619 const BookmarkNode* parent = GetFolder(); |
622 std::vector<const BookmarkNode*> nodes; | 620 std::vector<const BookmarkNode*> nodes; |
623 if (!left) | 621 if (!left) |
624 nodes = GetRightSelection(); | 622 nodes = GetRightSelection(); |
625 else if (parent) | 623 else if (parent) |
626 nodes.push_back(parent); | 624 nodes.push_back(parent); |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 username); | 1507 username); |
1510 } else if (sync_service_->SetupInProgress()) { | 1508 } else if (sync_service_->SetupInProgress()) { |
1511 status_label = l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS); | 1509 status_label = l10n_util::GetStringUTF16(IDS_SYNC_NTP_SETUP_IN_PROGRESS); |
1512 } else { | 1510 } else { |
1513 status_label = l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); | 1511 status_label = l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL); |
1514 } | 1512 } |
1515 GtkWidget* sync_status_label = gtk_bin_get_child(GTK_BIN(sync_status_menu_)); | 1513 GtkWidget* sync_status_label = gtk_bin_get_child(GTK_BIN(sync_status_menu_)); |
1516 gtk_label_set_label(GTK_LABEL(sync_status_label), | 1514 gtk_label_set_label(GTK_LABEL(sync_status_label), |
1517 UTF16ToUTF8(status_label).c_str()); | 1515 UTF16ToUTF8(status_label).c_str()); |
1518 } | 1516 } |
OLD | NEW |