| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/app/locales/locale_settings.h" | 9 #include "chrome/app/locales/locale_settings.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_folder_tree_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_folder_tree_model.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 int y, | 468 int y, |
| 469 bool is_mouse_gesture) { | 469 bool is_mouse_gesture) { |
| 470 DCHECK(source == table_view_ || source == tree_view_); | 470 DCHECK(source == table_view_ || source == tree_view_); |
| 471 bool is_table = (source == table_view_); | 471 bool is_table = (source == table_view_); |
| 472 ShowMenu(GetWidget()->GetHWND(), x, y, | 472 ShowMenu(GetWidget()->GetHWND(), x, y, |
| 473 is_table ? BookmarkContextMenu::BOOKMARK_MANAGER_TABLE : | 473 is_table ? BookmarkContextMenu::BOOKMARK_MANAGER_TABLE : |
| 474 BookmarkContextMenu::BOOKMARK_MANAGER_TREE); | 474 BookmarkContextMenu::BOOKMARK_MANAGER_TREE); |
| 475 } | 475 } |
| 476 | 476 |
| 477 void BookmarkManagerView::RunMenu(views::View* source, | 477 void BookmarkManagerView::RunMenu(views::View* source, |
| 478 const CPoint& pt, | 478 const gfx::Point& pt, |
| 479 HWND hwnd) { | 479 HWND hwnd) { |
| 480 // TODO(glen): when you change the buttons around and what not, futz with | 480 // TODO(glen): when you change the buttons around and what not, futz with |
| 481 // this to make it look good. If you end up keeping padding numbers make them | 481 // this to make it look good. If you end up keeping padding numbers make them |
| 482 // constants. | 482 // constants. |
| 483 if (!GetBookmarkModel()->IsLoaded()) | 483 if (!GetBookmarkModel()->IsLoaded()) |
| 484 return; | 484 return; |
| 485 | 485 |
| 486 int menu_x = pt.x; | 486 int menu_x = pt.x(); |
| 487 menu_x += UILayoutIsRightToLeft() ? (source->width() - 5) : | 487 menu_x += UILayoutIsRightToLeft() ? (source->width() - 5) : |
| 488 (-source->width() + 5); | 488 (-source->width() + 5); |
| 489 if (source->GetID() == kOrganizeMenuButtonID) { | 489 if (source->GetID() == kOrganizeMenuButtonID) { |
| 490 ShowMenu(hwnd, menu_x, pt.y + 2, | 490 ShowMenu(hwnd, menu_x, pt.y() + 2, |
| 491 BookmarkContextMenu::BOOKMARK_MANAGER_ORGANIZE_MENU); | 491 BookmarkContextMenu::BOOKMARK_MANAGER_ORGANIZE_MENU); |
| 492 } else if (source->GetID() == kToolsMenuButtonID) { | 492 } else if (source->GetID() == kToolsMenuButtonID) { |
| 493 ShowToolsMenu(hwnd, menu_x, pt.y + 2); | 493 ShowToolsMenu(hwnd, menu_x, pt.y() + 2); |
| 494 } else { | 494 } else { |
| 495 NOTREACHED(); | 495 NOTREACHED(); |
| 496 } | 496 } |
| 497 } | 497 } |
| 498 | 498 |
| 499 void BookmarkManagerView::ExecuteCommand(int id) { | 499 void BookmarkManagerView::ExecuteCommand(int id) { |
| 500 switch (id) { | 500 switch (id) { |
| 501 case IDS_BOOKMARK_MANAGER_IMPORT_MENU: | 501 case IDS_BOOKMARK_MANAGER_IMPORT_MENU: |
| 502 UserMetrics::RecordAction(L"BookmarkManager_Import", profile_); | 502 UserMetrics::RecordAction(L"BookmarkManager_Import", profile_); |
| 503 ShowImportBookmarksFileChooser(); | 503 ShowImportBookmarksFileChooser(); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 if (select_file_dialog_.get()) | 722 if (select_file_dialog_.get()) |
| 723 select_file_dialog_->ListenerDestroyed(); | 723 select_file_dialog_->ListenerDestroyed(); |
| 724 | 724 |
| 725 select_file_dialog_ = SelectFileDialog::Create(this); | 725 select_file_dialog_ = SelectFileDialog::Create(this); |
| 726 select_file_dialog_->SelectFile( | 726 select_file_dialog_->SelectFile( |
| 727 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), L"bookmarks.html", | 727 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), L"bookmarks.html", |
| 728 win_util::GetFileFilterFromPath(L"bookmarks.html"), L"html", | 728 win_util::GetFileFilterFromPath(L"bookmarks.html"), L"html", |
| 729 GetWidget()->GetHWND(), | 729 GetWidget()->GetHWND(), |
| 730 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); | 730 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); |
| 731 } | 731 } |
| OLD | NEW |