OLD | NEW |
1 // Copyright (c) 2006-2008 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/views/bookmark_editor_view.h" | 5 #include "chrome/browser/views/bookmark_editor_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 title_tf_.SetText(title); | 271 title_tf_.SetText(title); |
272 title_tf_.SetController(this); | 272 title_tf_.SetController(this); |
273 | 273 |
274 std::wstring url_text; | 274 std::wstring url_text; |
275 if (details_.type == EditDetails::EXISTING_NODE) { | 275 if (details_.type == EditDetails::EXISTING_NODE) { |
276 std::wstring languages = profile_ | 276 std::wstring languages = profile_ |
277 ? profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) | 277 ? profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) |
278 : std::wstring(); | 278 : std::wstring(); |
279 // The following URL is user-editable. We specify omit_username_password= | 279 // The following URL is user-editable. We specify omit_username_password= |
280 // false and unescape=false to show the original URL except IDN. | 280 // false and unescape=false to show the original URL except IDN. |
281 url_text = | 281 url_text = net::FormatUrl(details_.existing_node->GetURL(), languages, |
282 net::FormatUrl(details_.existing_node->GetURL(), languages, false, | 282 false, UnescapeRule::NONE, NULL, NULL, NULL); |
283 UnescapeRule::NONE, NULL, NULL); | |
284 } | 283 } |
285 url_tf_.SetText(url_text); | 284 url_tf_.SetText(url_text); |
286 url_tf_.SetController(this); | 285 url_tf_.SetController(this); |
287 | 286 |
288 if (show_tree_) { | 287 if (show_tree_) { |
289 tree_view_ = new views::TreeView(); | 288 tree_view_ = new views::TreeView(); |
290 new_group_button_.reset(new views::NativeButton( | 289 new_group_button_.reset(new views::NativeButton( |
291 this, l10n_util::GetString(IDS_BOOMARK_EDITOR_NEW_FOLDER_BUTTON))); | 290 this, l10n_util::GetString(IDS_BOOMARK_EDITOR_NEW_FOLDER_BUTTON))); |
292 new_group_button_->SetParentOwned(false); | 291 new_group_button_->SetParentOwned(false); |
293 tree_view_->SetContextMenuController(this); | 292 tree_view_->SetContextMenuController(this); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 break; | 565 break; |
567 } | 566 } |
568 } | 567 } |
569 DCHECK(child_bb_node); | 568 DCHECK(child_bb_node); |
570 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); | 569 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); |
571 } | 570 } |
572 ApplyNameChangesAndCreateNewGroups(child_bb_node, child_b_node, | 571 ApplyNameChangesAndCreateNewGroups(child_bb_node, child_b_node, |
573 parent_b_node, parent_bb_node); | 572 parent_b_node, parent_bb_node); |
574 } | 573 } |
575 } | 574 } |
OLD | NEW |