Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: chrome/browser/gtk/browser_toolbar_gtk.cc

Issue 192017: Convert std::wstring encoding names to std::string in a bunch of files. (Closed)
Patch Set: mac and linux fixes Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_toolbar_gtk.h" 5 #include "chrome/browser/gtk/browser_toolbar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include "app/gtk_dnd_util.h" 10 #include "app/gtk_dnd_util.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 EncodingMenuController controller; 112 EncodingMenuController controller;
113 EncodingMenuController::EncodingMenuItemList items; 113 EncodingMenuController::EncodingMenuItemList items;
114 controller.GetEncodingMenuItems(profile, &items); 114 controller.GetEncodingMenuItems(profile, &items);
115 115
116 MenuGtk* menu = new MenuGtk(delegate, false); 116 MenuGtk* menu = new MenuGtk(delegate, false);
117 GSList* radio_group = NULL; 117 GSList* radio_group = NULL;
118 for (EncodingMenuController::EncodingMenuItemList::const_iterator i = 118 for (EncodingMenuController::EncodingMenuItemList::const_iterator i =
119 items.begin(); 119 items.begin();
120 i != items.end(); ++i) { 120 i != items.end(); ++i) {
121 if (i == items.begin()) { 121 if (i == items.begin()) {
122 menu->AppendCheckMenuItemWithLabel(i->first, WideToUTF8(i->second)); 122 menu->AppendCheckMenuItemWithLabel(i->first, UTF16ToUTF8(i->second));
123 } else if (i->first == 0) { 123 } else if (i->first == 0) {
124 menu->AppendSeparator(); 124 menu->AppendSeparator();
125 } else { 125 } else {
126 GtkWidget* item = 126 GtkWidget* item =
127 gtk_radio_menu_item_new_with_label(radio_group, 127 gtk_radio_menu_item_new_with_label(radio_group,
128 WideToUTF8(i->second).c_str()); 128 UTF16ToUTF8(i->second).c_str());
129 radio_group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item)); 129 radio_group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item));
130 menu->AppendMenuItem(i->first, item); 130 menu->AppendMenuItem(i->first, item);
131 } 131 }
132 } 132 }
133 return menu; 133 return menu;
134 } 134 }
135 135
136 void BrowserToolbarGtk::Init(Profile* profile, 136 void BrowserToolbarGtk::Init(Profile* profile,
137 GtkWindow* top_level_window) { 137 GtkWindow* top_level_window) {
138 // Make sure to tell the location bar the profile before calling its Init. 138 // Make sure to tell the location bar the profile before calling its Init.
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 g_signal_stop_emission_by_name(menu, "move-current"); 712 g_signal_stop_emission_by_name(menu, "move-current");
713 default: 713 default:
714 break; 714 break;
715 } 715 }
716 } 716 }
717 717
718 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { 718 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const {
719 // If we're a popup window, only show the location bar (omnibox). 719 // If we're a popup window, only show the location bar (omnibox).
720 return browser_->type() != Browser::TYPE_NORMAL; 720 return browser_->type() != Browser::TYPE_NORMAL;
721 } 721 }
OLDNEW
« no previous file with comments | « chrome/browser/encoding_menu_controller_unittest.cc ('k') | chrome/browser/gtk/options/fonts_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698