OLD | NEW |
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_editor_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_URL_LABEL)); | 375 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_URL_LABEL)); |
376 | 376 |
377 std::string languages = | 377 std::string languages = |
378 profile_ ? profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) | 378 profile_ ? profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) |
379 : std::string(); | 379 : std::string(); |
380 // Because this gets parsed by FixupURL(), it's safe to omit the scheme or | 380 // Because this gets parsed by FixupURL(), it's safe to omit the scheme or |
381 // trailing slash, and unescape most characters, but we need to not drop any | 381 // trailing slash, and unescape most characters, but we need to not drop any |
382 // username/password, or unescape anything that changes the meaning. | 382 // username/password, or unescape anything that changes the meaning. |
383 string16 url_text = net::FormatUrl(url, languages, | 383 string16 url_text = net::FormatUrl(url, languages, |
384 net::kFormatUrlOmitAll & ~net::kFormatUrlOmitUsernamePassword, | 384 net::kFormatUrlOmitAll & ~net::kFormatUrlOmitUsernamePassword, |
385 UnescapeRule::SPACES, NULL, NULL, NULL); | 385 net::UnescapeRule::SPACES, NULL, NULL, NULL); |
386 | 386 |
387 url_tf_ = new views::Textfield; | 387 url_tf_ = new views::Textfield; |
388 url_tf_->SetText(UTF16ToWide(url_text)); | 388 url_tf_->SetText(UTF16ToWide(url_text)); |
389 url_tf_->SetController(this); | 389 url_tf_->SetController(this); |
390 url_tf_->SetAccessibleName(url_label_->GetText()); | 390 url_tf_->SetAccessibleName(url_label_->GetText()); |
391 | 391 |
392 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 392 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
393 | 393 |
394 layout->StartRow(0, labels_column_set_id); | 394 layout->StartRow(0, labels_column_set_id); |
395 layout->AddView(url_label_); | 395 layout->AddView(url_label_); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 EditorNode* editor_node, | 653 EditorNode* editor_node, |
654 BookmarkExpandedStateTracker::Nodes* expanded_nodes) { | 654 BookmarkExpandedStateTracker::Nodes* expanded_nodes) { |
655 if (!tree_view_->IsExpanded(editor_node)) | 655 if (!tree_view_->IsExpanded(editor_node)) |
656 return; | 656 return; |
657 | 657 |
658 if (editor_node->value != 0) // The root is 0 | 658 if (editor_node->value != 0) // The root is 0 |
659 expanded_nodes->insert(bb_model_->GetNodeByID(editor_node->value)); | 659 expanded_nodes->insert(bb_model_->GetNodeByID(editor_node->value)); |
660 for (int i = 0; i < editor_node->child_count(); ++i) | 660 for (int i = 0; i < editor_node->child_count(); ++i) |
661 UpdateExpandedNodes(editor_node->GetChild(i), expanded_nodes); | 661 UpdateExpandedNodes(editor_node->GetChild(i), expanded_nodes); |
662 } | 662 } |
OLD | NEW |