| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |