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

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

Issue 115665: Middle clicking on a bookmark from the bookmark manager now... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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_manager_view.h ('k') | views/controls/table/table_view.h » ('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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 SelectInTree(nodes[0]); 340 SelectInTree(nodes[0]);
341 return; 341 return;
342 } 342 }
343 // TODO(sky): OnDoubleClick needs a handle to the current mouse event so that 343 // TODO(sky): OnDoubleClick needs a handle to the current mouse event so that
344 // we can use 344 // we can use
345 // event_utils::DispositionFromEventFlags(sender->mouse_event_flags()) . 345 // event_utils::DispositionFromEventFlags(sender->mouse_event_flags()) .
346 bookmark_utils::OpenAll( 346 bookmark_utils::OpenAll(
347 GetWidget()->GetNativeView(), profile_, NULL, nodes, CURRENT_TAB); 347 GetWidget()->GetNativeView(), profile_, NULL, nodes, CURRENT_TAB);
348 } 348 }
349 349
350 void BookmarkManagerView::OnMiddleClick() {
351 std::vector<BookmarkNode*> nodes = GetSelectedTableNodes();
352 if (nodes.empty())
353 return;
354 if (nodes.size() == 1 && nodes[0]->is_folder()) {
355 // Middle clicking on a folder results in no action.
356 return;
357 }
358
359 bookmark_utils::OpenAll(
360 GetWidget()->GetNativeView(), profile_, NULL, nodes, NEW_FOREGROUND_TAB);
361 }
362
350 void BookmarkManagerView::OnTableViewDelete(views::TableView* table) { 363 void BookmarkManagerView::OnTableViewDelete(views::TableView* table) {
351 std::vector<BookmarkNode*> nodes = GetSelectedTableNodes(); 364 std::vector<BookmarkNode*> nodes = GetSelectedTableNodes();
352 if (nodes.empty()) 365 if (nodes.empty())
353 return; 366 return;
354 for (size_t i = 0; i < nodes.size(); ++i) { 367 for (size_t i = 0; i < nodes.size(); ++i) {
355 GetBookmarkModel()->Remove(nodes[i]->GetParent(), 368 GetBookmarkModel()->Remove(nodes[i]->GetParent(),
356 nodes[i]->GetParent()->IndexOfChild(nodes[i])); 369 nodes[i]->GetParent()->IndexOfChild(nodes[i]));
357 } 370 }
358 } 371 }
359 372
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 file_type_info.extensions.resize(1); 749 file_type_info.extensions.resize(1);
737 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); 750 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
738 file_type_info.include_all_files = true; 751 file_type_info.include_all_files = true;
739 select_file_dialog_ = SelectFileDialog::Create(this); 752 select_file_dialog_ = SelectFileDialog::Create(this);
740 select_file_dialog_->SelectFile( 753 select_file_dialog_->SelectFile(
741 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), 754 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(),
742 FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0, 755 FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0,
743 L"html", GetWidget()->GetNativeView(), 756 L"html", GetWidget()->GetNativeView(),
744 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); 757 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
745 } 758 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_manager_view.h ('k') | views/controls/table/table_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698