OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/bookmarks/bookmark_sub_menu_model_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 AddSubMenu(kBookmarkItemCommandId, label, submenu); | 93 AddSubMenu(kBookmarkItemCommandId, label, submenu); |
94 submenus_.push_back(submenu); | 94 submenus_.push_back(submenu); |
95 } | 95 } |
96 | 96 |
97 void BookmarkNodeMenuModel::NavigateToMenuItem( | 97 void BookmarkNodeMenuModel::NavigateToMenuItem( |
98 int index, | 98 int index, |
99 WindowOpenDisposition disposition) { | 99 WindowOpenDisposition disposition) { |
100 const BookmarkNode* node = node_->GetChild(index); | 100 const BookmarkNode* node = node_->GetChild(index); |
101 DCHECK(node); | 101 DCHECK(node); |
102 page_navigator_->OpenURL(OpenURLParams( | 102 page_navigator_->OpenURL(OpenURLParams( |
103 node->url(), GURL(), disposition, | 103 node->url(), content::Referrer(), disposition, |
104 content::PAGE_TRANSITION_AUTO_BOOKMARK, | 104 content::PAGE_TRANSITION_AUTO_BOOKMARK, |
105 false)); // is_renderer_initiated | 105 false)); // is_renderer_initiated |
106 } | 106 } |
107 | 107 |
108 BookmarkSubMenuModel::BookmarkSubMenuModel( | 108 BookmarkSubMenuModel::BookmarkSubMenuModel( |
109 ui::SimpleMenuModel::Delegate* delegate, | 109 ui::SimpleMenuModel::Delegate* delegate, |
110 Browser* browser) | 110 Browser* browser) |
111 : BookmarkNodeMenuModel(delegate, NULL, NULL, browser), | 111 : BookmarkNodeMenuModel(delegate, NULL, NULL, browser), |
112 browser_(browser), | 112 browser_(browser), |
113 fixed_items_(0), | 113 fixed_items_(0), |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 bool BookmarkSubMenuModel::IsVisibleAt(int index) const { | 192 bool BookmarkSubMenuModel::IsVisibleAt(int index) const { |
193 // We don't want the delegate interfering with bookmark items. | 193 // We don't want the delegate interfering with bookmark items. |
194 return index >= fixed_items_ || SimpleMenuModel::IsVisibleAt(index); | 194 return index >= fixed_items_ || SimpleMenuModel::IsVisibleAt(index); |
195 } | 195 } |
196 | 196 |
197 // static | 197 // static |
198 bool BookmarkSubMenuModel::IsBookmarkItemCommandId(int command_id) { | 198 bool BookmarkSubMenuModel::IsBookmarkItemCommandId(int command_id) { |
199 return command_id == kBookmarkItemCommandId; | 199 return command_id == kBookmarkItemCommandId; |
200 } | 200 } |
OLD | NEW |