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

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

Issue 2155243007: Turn Bookmark Menus Async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge the pretarget handlers Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.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) 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_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/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 const gfx::Point& point, 237 const gfx::Point& point,
238 ui::MenuSourceType source_type) { 238 ui::MenuSourceType source_type) {
239 DCHECK_EQ(tree_view_, source); 239 DCHECK_EQ(tree_view_, source);
240 if (!tree_view_->GetSelectedNode()) 240 if (!tree_view_->GetSelectedNode())
241 return; 241 return;
242 running_menu_for_root_ = 242 running_menu_for_root_ =
243 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == 243 (tree_model_->GetParent(tree_view_->GetSelectedNode()) ==
244 tree_model_->GetRoot()); 244 tree_model_->GetRoot());
245 245
246 context_menu_runner_.reset(new views::MenuRunner( 246 context_menu_runner_.reset(new views::MenuRunner(
247 GetMenuModel(), 247 GetMenuModel(), views::MenuRunner::HAS_MNEMONICS |
248 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU)); 248 views::MenuRunner::CONTEXT_MENU |
249 views::MenuRunner::ASYNC));
249 250
250 if (context_menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), 251 if (context_menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(),
251 NULL, 252 NULL,
252 gfx::Rect(point, gfx::Size()), 253 gfx::Rect(point, gfx::Size()),
253 views::MENU_ANCHOR_TOPRIGHT, 254 views::MENU_ANCHOR_TOPRIGHT,
254 source_type) == 255 source_type) ==
255 views::MenuRunner::MENU_DELETED) { 256 views::MenuRunner::MENU_DELETED) {
256 return; 257 return;
257 } 258 }
258 } 259 }
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 Profile* profile, 650 Profile* profile,
650 const BookmarkEditor::EditDetails& details, 651 const BookmarkEditor::EditDetails& details,
651 BookmarkEditor::Configuration configuration) { 652 BookmarkEditor::Configuration configuration) {
652 DCHECK(profile); 653 DCHECK(profile);
653 BookmarkEditorView* editor = new BookmarkEditorView( 654 BookmarkEditorView* editor = new BookmarkEditorView(
654 profile, details.parent_node, details, configuration); 655 profile, details.parent_node, details, configuration);
655 editor->Show(parent_window); 656 editor->Show(parent_window);
656 } 657 }
657 658
658 } // namespace chrome 659 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698