| 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/bookmarks/bookmark_context_menu_controller.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 PageNavigator* navigator, | 46 PageNavigator* navigator, |
| 47 const BookmarkNode* parent, | 47 const BookmarkNode* parent, |
| 48 const std::vector<const BookmarkNode*>& selection) | 48 const std::vector<const BookmarkNode*>& selection) |
| 49 : parent_window_(parent_window), | 49 : parent_window_(parent_window), |
| 50 delegate_(delegate), | 50 delegate_(delegate), |
| 51 browser_(browser), | 51 browser_(browser), |
| 52 profile_(profile), | 52 profile_(profile), |
| 53 navigator_(navigator), | 53 navigator_(navigator), |
| 54 parent_(parent), | 54 parent_(parent), |
| 55 selection_(selection), | 55 selection_(selection), |
| 56 model_(BookmarkModelFactory::GetForProfile(profile)), | 56 model_(BookmarkModelFactory::GetForBrowserContext(profile)), |
| 57 weak_factory_(this) { | 57 weak_factory_(this) { |
| 58 DCHECK(profile_); | 58 DCHECK(profile_); |
| 59 DCHECK(model_->loaded()); | 59 DCHECK(model_->loaded()); |
| 60 menu_model_.reset(new ui::SimpleMenuModel(this)); | 60 menu_model_.reset(new ui::SimpleMenuModel(this)); |
| 61 model_->AddObserver(this); | 61 model_->AddObserver(this); |
| 62 | 62 |
| 63 BuildMenu(); | 63 BuildMenu(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 BookmarkContextMenuController::~BookmarkContextMenuController() { | 66 BookmarkContextMenuController::~BookmarkContextMenuController() { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 return !managed->managed_node()->empty(); | 429 return !managed->managed_node()->empty(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 return true; | 432 return true; |
| 433 } | 433 } |
| 434 | 434 |
| 435 void BookmarkContextMenuController::BookmarkModelChanged() { | 435 void BookmarkContextMenuController::BookmarkModelChanged() { |
| 436 if (delegate_) | 436 if (delegate_) |
| 437 delegate_->CloseMenu(); | 437 delegate_->CloseMenu(); |
| 438 } | 438 } |
| OLD | NEW |