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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_menu_delegate.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
10 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" 10 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 chrome::OpenAll(parent_->GetNativeWindow(), page_navigator_, selection, 169 chrome::OpenAll(parent_->GetNativeWindow(), page_navigator_, selection,
170 ui::DispositionFromEventFlags(mouse_event_flags), 170 ui::DispositionFromEventFlags(mouse_event_flags),
171 profile_); 171 profile_);
172 // NOTE: |this| may be deleted. 172 // NOTE: |this| may be deleted.
173 } 173 }
174 174
175 bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu( 175 bool BookmarkMenuDelegate::ShouldExecuteCommandWithoutClosingMenu(
176 int id, 176 int id,
177 const ui::Event& event) { 177 const ui::Event& event) {
178 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && 178 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) &&
179 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB; 179 ui::DispositionFromEventFlags(event.flags()) ==
180 WindowOpenDisposition::NEW_BACKGROUND_TAB;
180 } 181 }
181 182
182 bool BookmarkMenuDelegate::GetDropFormats( 183 bool BookmarkMenuDelegate::GetDropFormats(
183 MenuItemView* menu, 184 MenuItemView* menu,
184 int* formats, 185 int* formats,
185 std::set<ui::Clipboard::FormatType>* format_types) { 186 std::set<ui::Clipboard::FormatType>* format_types) {
186 *formats = ui::OSExchangeData::URL; 187 *formats = ui::OSExchangeData::URL;
187 format_types->insert(BookmarkNodeData::GetBookmarkFormatType()); 188 format_types->insert(BookmarkNodeData::GetBookmarkFormatType());
188 return true; 189 return true;
189 } 190 }
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 544 }
544 AddMenuToMaps(child_menu_item, node); 545 AddMenuToMaps(child_menu_item, node);
545 } 546 }
546 } 547 }
547 548
548 void BookmarkMenuDelegate::AddMenuToMaps(MenuItemView* menu, 549 void BookmarkMenuDelegate::AddMenuToMaps(MenuItemView* menu,
549 const BookmarkNode* node) { 550 const BookmarkNode* node) {
550 menu_id_to_node_map_[menu->GetCommand()] = node; 551 menu_id_to_node_map_[menu->GetCommand()] = node;
551 node_to_menu_map_[node] = menu; 552 node_to_menu_map_[node] = menu;
552 } 553 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698