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

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

Issue 3142030: Remove wstrings from bookmarks, part 6. (Closed)
Patch Set: fix views and tests Created 10 years, 4 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/bookmark_bubble_view.h" 5 #include "chrome/browser/views/bookmark_bubble_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/keyboard_codes.h" 9 #include "base/keyboard_codes.h"
10 #include "base/string16.h"
10 #include "base/string_util.h" 11 #include "base/string_util.h"
11 #include "chrome/app/chrome_dll_resource.h" 12 #include "chrome/app/chrome_dll_resource.h"
12 #include "chrome/browser/bookmarks/bookmark_editor.h" 13 #include "chrome/browser/bookmarks/bookmark_editor.h"
13 #include "chrome/browser/bookmarks/bookmark_model.h" 14 #include "chrome/browser/bookmarks/bookmark_model.h"
14 #include "chrome/browser/bookmarks/bookmark_utils.h" 15 #include "chrome/browser/bookmarks/bookmark_utils.h"
15 #include "chrome/browser/metrics/user_metrics.h" 16 #include "chrome/browser/metrics/user_metrics.h"
16 #include "chrome/browser/profile.h" 17 #include "chrome/browser/profile.h"
17 #include "chrome/browser/views/info_bubble.h" 18 #include "chrome/browser/views/info_bubble.h"
18 #include "chrome/common/notification_service.h" 19 #include "chrome/common/notification_service.h"
19 #include "gfx/canvas.h" 20 #include "gfx/canvas.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 384 }
384 } 385 }
385 386
386 void BookmarkBubbleView::ApplyEdits() { 387 void BookmarkBubbleView::ApplyEdits() {
387 // Set this to make sure we don't attempt to apply edits again. 388 // Set this to make sure we don't attempt to apply edits again.
388 apply_edits_ = false; 389 apply_edits_ = false;
389 390
390 BookmarkModel* model = profile_->GetBookmarkModel(); 391 BookmarkModel* model = profile_->GetBookmarkModel();
391 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); 392 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_);
392 if (node) { 393 if (node) {
393 const std::wstring new_title = UTF16ToWide(title_tf_->text()); 394 const string16 new_title = title_tf_->text();
394 if (new_title != node->GetTitle()) { 395 if (new_title != node->GetTitleAsString16()) {
395 model->SetTitle(node, new_title); 396 model->SetTitle(node, new_title);
396 UserMetrics::RecordAction( 397 UserMetrics::RecordAction(
397 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"), 398 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"),
398 profile_); 399 profile_);
399 } 400 }
400 // Last index means 'Choose another folder...' 401 // Last index means 'Choose another folder...'
401 if (parent_combobox_->selected_item() < 402 if (parent_combobox_->selected_item() <
402 parent_model_.GetItemCount() - 1) { 403 parent_model_.GetItemCount() - 1) {
403 const BookmarkNode* new_parent = 404 const BookmarkNode* new_parent =
404 parent_model_.GetNodeAt(parent_combobox_->selected_item()); 405 parent_model_.GetNodeAt(parent_combobox_->selected_item());
405 if (new_parent != node->GetParent()) { 406 if (new_parent != node->GetParent()) {
406 UserMetrics::RecordAction( 407 UserMetrics::RecordAction(
407 UserMetricsAction("BookmarkBubble_ChangeParent"), profile_); 408 UserMetricsAction("BookmarkBubble_ChangeParent"), profile_);
408 model->Move(node, new_parent, new_parent->GetChildCount()); 409 model->Move(node, new_parent, new_parent->GetChildCount());
409 } 410 }
410 } 411 }
411 } 412 }
412 } 413 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/bookmark_change_processor.cc ('k') | chrome/test/live_sync/bookmark_model_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698