| 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/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return; | 278 return; |
| 279 running_menu_for_root_ = | 279 running_menu_for_root_ = |
| 280 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == | 280 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == |
| 281 tree_model_->GetRoot()); | 281 tree_model_->GetRoot()); |
| 282 | 282 |
| 283 views::MenuModelAdapter adapter(GetMenuModel()); | 283 views::MenuModelAdapter adapter(GetMenuModel()); |
| 284 context_menu_runner_.reset(new views::MenuRunner(adapter.CreateMenu())); | 284 context_menu_runner_.reset(new views::MenuRunner(adapter.CreateMenu())); |
| 285 | 285 |
| 286 if (context_menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), | 286 if (context_menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), |
| 287 NULL, gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPRIGHT, | 287 NULL, gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPRIGHT, |
| 288 views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED) | 288 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
| 289 views::MenuRunner::MENU_DELETED) |
| 289 return; | 290 return; |
| 290 } | 291 } |
| 291 | 292 |
| 292 void BookmarkEditorView::Init() { | 293 void BookmarkEditorView::Init() { |
| 293 bb_model_ = BookmarkModelFactory::GetForProfile(profile_); | 294 bb_model_ = BookmarkModelFactory::GetForProfile(profile_); |
| 294 DCHECK(bb_model_); | 295 DCHECK(bb_model_); |
| 295 bb_model_->AddObserver(this); | 296 bb_model_->AddObserver(this); |
| 296 | 297 |
| 297 title_label_ = new views::Label( | 298 title_label_ = new views::Label( |
| 298 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NAME_LABEL)); | 299 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NAME_LABEL)); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); | 657 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); |
| 657 } | 658 } |
| 658 return context_menu_model_.get(); | 659 return context_menu_model_.get(); |
| 659 } | 660 } |
| 660 | 661 |
| 661 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, | 662 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, |
| 662 const string16& title) { | 663 const string16& title) { |
| 663 if (!title.empty()) | 664 if (!title.empty()) |
| 664 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); | 665 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); |
| 665 } | 666 } |
| OLD | NEW |