OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/wrench_menu.h" | 5 #include "chrome/browser/ui/views/toolbar/wrench_menu.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 if (menu->HasSubmenu() && feedback_menu_item_ && | 1214 if (menu->HasSubmenu() && feedback_menu_item_ && |
1215 feedback_menu_item_->IsSelected()) { | 1215 feedback_menu_item_->IsSelected()) { |
1216 // It's okay to just turn off the animation and no to take care the | 1216 // It's okay to just turn off the animation and no to take care the |
1217 // animation back because the menu widget will be recreated next time | 1217 // animation back because the menu widget will be recreated next time |
1218 // it's opened. See ToolbarView::RunMenu() and Init() of this class. | 1218 // it's opened. See ToolbarView::RunMenu() and Init() of this class. |
1219 menu->GetSubmenu()->GetWidget()-> | 1219 menu->GetSubmenu()->GetWidget()-> |
1220 SetVisibilityChangedAnimationsEnabled(false); | 1220 SetVisibilityChangedAnimationsEnabled(false); |
1221 } | 1221 } |
1222 } | 1222 } |
1223 | 1223 |
| 1224 bool WrenchMenu::ShouldCloseOnDragComplete() { |
| 1225 return false; |
| 1226 } |
| 1227 |
1224 void WrenchMenu::BookmarkModelChanged() { | 1228 void WrenchMenu::BookmarkModelChanged() { |
1225 DCHECK(bookmark_menu_delegate_.get()); | 1229 DCHECK(bookmark_menu_delegate_.get()); |
1226 if (!bookmark_menu_delegate_->is_mutating_model()) | 1230 if (!bookmark_menu_delegate_->is_mutating_model()) |
1227 root_->Cancel(); | 1231 root_->Cancel(); |
1228 } | 1232 } |
1229 | 1233 |
1230 void WrenchMenu::Observe(int type, | 1234 void WrenchMenu::Observe(int type, |
1231 const content::NotificationSource& source, | 1235 const content::NotificationSource& source, |
1232 const content::NotificationDetails& details) { | 1236 const content::NotificationDetails& details) { |
1233 switch (type) { | 1237 switch (type) { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 0, | 1408 0, |
1405 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1409 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
1406 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); | 1410 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); |
1407 } | 1411 } |
1408 | 1412 |
1409 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { | 1413 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { |
1410 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1414 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); |
1411 DCHECK(ix != command_id_to_entry_.end()); | 1415 DCHECK(ix != command_id_to_entry_.end()); |
1412 return ix->second.second; | 1416 return ix->second.second; |
1413 } | 1417 } |
OLD | NEW |