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

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

Issue 113940: Make Textfield more portable.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
« no previous file with comments | « chrome/browser/views/bookmark_editor_view.cc ('k') | chrome/browser/views/bug_report_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/views/bookmark_manager_view.h" 5 #include "chrome/browser/views/bookmark_manager_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/gfx/canvas.h" 9 #include "app/gfx/canvas.h"
10 #include "app/gfx/color_utils.h" 10 #include "app/gfx/color_utils.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 } else { 572 } else {
573 NOTREACHED(); 573 NOTREACHED();
574 } 574 }
575 } 575 }
576 576
577 void BookmarkManagerView::FileSelectionCanceled(void* params) { 577 void BookmarkManagerView::FileSelectionCanceled(void* params) {
578 select_file_dialog_ = NULL; 578 select_file_dialog_ = NULL;
579 } 579 }
580 580
581 BookmarkTableModel* BookmarkManagerView::CreateSearchTableModel() { 581 BookmarkTableModel* BookmarkManagerView::CreateSearchTableModel() {
582 std::wstring search_text = search_tf_->GetText(); 582 std::wstring search_text = search_tf_->text();
583 if (search_text.empty()) 583 if (search_text.empty())
584 return NULL; 584 return NULL;
585 return BookmarkTableModel::CreateSearchTableModel(GetBookmarkModel(), 585 return BookmarkTableModel::CreateSearchTableModel(GetBookmarkModel(),
586 search_text); 586 search_text);
587 } 587 }
588 588
589 void BookmarkManagerView::SetTableModel(BookmarkTableModel* new_table_model, 589 void BookmarkManagerView::SetTableModel(BookmarkTableModel* new_table_model,
590 BookmarkNode* parent_node, 590 BookmarkNode* parent_node,
591 bool is_search) { 591 bool is_search) {
592 // Be sure and reset the model on the view before updating table_model_. 592 // Be sure and reset the model on the view before updating table_model_.
593 // Otherwise the view will attempt to use the deleted model when we set the 593 // Otherwise the view will attempt to use the deleted model when we set the
594 // new one. 594 // new one.
595 table_view_->SetModel(NULL); 595 table_view_->SetModel(NULL);
596 table_view_->SetShowPathColumn(!parent_node); 596 table_view_->SetShowPathColumn(!parent_node);
597 table_view_->SetModel(new_table_model); 597 table_view_->SetModel(new_table_model);
598 table_view_->set_parent_node(parent_node); 598 table_view_->set_parent_node(parent_node);
599 table_model_.reset(new_table_model); 599 table_model_.reset(new_table_model);
600 if (!is_search || (new_table_model && new_table_model->RowCount() > 0)) { 600 if (!is_search || (new_table_model && new_table_model->RowCount() > 0)) {
601 table_view_->SetAltText(std::wstring()); 601 table_view_->SetAltText(std::wstring());
602 } else if (search_tf_->GetText().empty()) { 602 } else if (search_tf_->text().empty()) {
603 table_view_->SetAltText( 603 table_view_->SetAltText(
604 l10n_util::GetString(IDS_BOOKMARK_MANAGER_NO_SEARCH_TEXT)); 604 l10n_util::GetString(IDS_BOOKMARK_MANAGER_NO_SEARCH_TEXT));
605 } else { 605 } else {
606 table_view_->SetAltText( 606 table_view_->SetAltText(
607 l10n_util::GetStringF(IDS_BOOKMARK_MANAGER_NO_RESULTS, 607 l10n_util::GetStringF(IDS_BOOKMARK_MANAGER_NO_RESULTS,
608 search_tf_->GetText())); 608 search_tf_->text()));
609 } 609 }
610 } 610 }
611 611
612 void BookmarkManagerView::PerformSearch() { 612 void BookmarkManagerView::PerformSearch() {
613 search_factory_.RevokeAll(); 613 search_factory_.RevokeAll();
614 // Reset the controller, otherwise when we change the selection we'll get 614 // Reset the controller, otherwise when we change the selection we'll get
615 // notified and update the model twice. 615 // notified and update the model twice.
616 tree_view_->SetController(NULL); 616 tree_view_->SetController(NULL);
617 tree_view_->SetSelectedNode(tree_model_->search_node()); 617 tree_view_->SetSelectedNode(tree_model_->search_node());
618 tree_view_->SetController(this); 618 tree_view_->SetController(this);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 file_type_info.extensions.resize(1); 768 file_type_info.extensions.resize(1);
769 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); 769 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
770 file_type_info.include_all_files = true; 770 file_type_info.include_all_files = true;
771 select_file_dialog_ = SelectFileDialog::Create(this); 771 select_file_dialog_ = SelectFileDialog::Create(this);
772 select_file_dialog_->SelectFile( 772 select_file_dialog_->SelectFile(
773 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), 773 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(),
774 FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0, 774 FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0,
775 L"html", GetWidget()->GetNativeView(), 775 L"html", GetWidget()->GetNativeView(),
776 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); 776 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
777 } 777 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_editor_view.cc ('k') | chrome/browser/views/bug_report_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698