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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 8113031: Change std::wstring to string16 for views::Label and views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/bookmarks/bookmark_bubble_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
6 6
7 #include "base/string16.h" 7 #include "base/string16.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 static bool initialized = false; 183 static bool initialized = false;
184 if (!initialized) { 184 if (!initialized) {
185 kTitleColor = color_utils::GetReadableColor(SkColorSetRGB(6, 45, 117), 185 kTitleColor = color_utils::GetReadableColor(SkColorSetRGB(6, 45, 117),
186 Bubble::kBackgroundColor); 186 Bubble::kBackgroundColor);
187 kCloseImage = ResourceBundle::GetSharedInstance().GetBitmapNamed( 187 kCloseImage = ResourceBundle::GetSharedInstance().GetBitmapNamed(
188 IDR_INFO_BUBBLE_CLOSE); 188 IDR_INFO_BUBBLE_CLOSE);
189 189
190 initialized = true; 190 initialized = true;
191 } 191 }
192 192
193 remove_link_ = new views::Link(UTF16ToWide(l10n_util::GetStringUTF16( 193 remove_link_ = new views::Link(l10n_util::GetStringUTF16(
194 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK))); 194 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK));
195 remove_link_->set_listener(this); 195 remove_link_->set_listener(this);
196 196
197 edit_button_ = new views::NativeTextButton( 197 edit_button_ = new views::NativeTextButton(
198 this, 198 this,
199 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS))); 199 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS)));
200 200
201 close_button_ = new views::NativeTextButton( 201 close_button_ = new views::NativeTextButton(
202 this, UTF16ToWide(l10n_util::GetStringUTF16(IDS_DONE))); 202 this, UTF16ToWide(l10n_util::GetStringUTF16(IDS_DONE)));
203 close_button_->SetIsDefault(true); 203 close_button_->SetIsDefault(true);
204 204
205 views::Label* combobox_label = new views::Label( 205 views::Label* combobox_label = new views::Label(
206 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT))); 206 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT));
207 207
208 parent_combobox_ = new views::Combobox(&parent_model_); 208 parent_combobox_ = new views::Combobox(&parent_model_);
209 parent_combobox_->SetSelectedItem(parent_model_.node_parent_index()); 209 parent_combobox_->SetSelectedItem(parent_model_.node_parent_index());
210 parent_combobox_->set_listener(this); 210 parent_combobox_->set_listener(this);
211 parent_combobox_->SetAccessibleName( 211 parent_combobox_->SetAccessibleName(combobox_label->GetText());
212 WideToUTF16Hack(combobox_label->GetText()));
213 212
214 views::Label* title_label = new views::Label( 213 views::Label* title_label = new views::Label(
215 UTF16ToWide(l10n_util::GetStringUTF16( 214 l10n_util::GetStringUTF16(
216 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : 215 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED :
217 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK))); 216 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK));
218 title_label->SetFont( 217 title_label->SetFont(
219 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont)); 218 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont));
220 title_label->SetColor(kTitleColor); 219 title_label->SetColor(kTitleColor);
221 220
222 GridLayout* layout = new GridLayout(this); 221 GridLayout* layout = new GridLayout(this);
223 SetLayoutManager(layout); 222 SetLayoutManager(layout);
224 223
225 ColumnSet* cs = layout->AddColumnSet(0); 224 ColumnSet* cs = layout->AddColumnSet(0);
226 225
227 // Top (title) row. 226 // Top (title) row.
(...skipping 22 matching lines...) Expand all
250 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing - 2); 249 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing - 2);
251 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0, 250 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
252 GridLayout::USE_PREF, 0, 0); 251 GridLayout::USE_PREF, 0, 0);
253 252
254 layout->StartRow(0, 0); 253 layout->StartRow(0, 0);
255 layout->AddView(title_label); 254 layout->AddView(title_label);
256 layout->AddView(remove_link_); 255 layout->AddView(remove_link_);
257 256
258 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 257 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
259 layout->StartRow(0, 2); 258 layout->StartRow(0, 2);
260 layout->AddView(new views::Label(UTF16ToWide( 259 layout->AddView(new views::Label(
261 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_TITLE_TEXT)))); 260 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_TITLE_TEXT)));
262 title_tf_ = new views::Textfield(); 261 title_tf_ = new views::Textfield();
263 title_tf_->SetText(GetTitle()); 262 title_tf_->SetText(GetTitle());
264 layout->AddView(title_tf_); 263 layout->AddView(title_tf_);
265 264
266 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 265 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
267 266
268 layout->StartRow(0, 2); 267 layout->StartRow(0, 2);
269 layout->AddView(combobox_label); 268 layout->AddView(combobox_label);
270 layout->AddView(parent_combobox_); 269 layout->AddView(parent_combobox_);
271 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 270 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 const BookmarkNode* new_parent = 421 const BookmarkNode* new_parent =
423 parent_model_.GetNodeAt(parent_combobox_->selected_item()); 422 parent_model_.GetNodeAt(parent_combobox_->selected_item());
424 if (new_parent != node->parent()) { 423 if (new_parent != node->parent()) {
425 UserMetrics::RecordAction( 424 UserMetrics::RecordAction(
426 UserMetricsAction("BookmarkBubble_ChangeParent")); 425 UserMetricsAction("BookmarkBubble_ChangeParent"));
427 model->Move(node, new_parent, new_parent->child_count()); 426 model->Move(node, new_parent, new_parent->child_count());
428 } 427 }
429 } 428 }
430 } 429 }
431 } 430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698