| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/extensions/browser_action_overflow_menu_controlle
r.h" | 5 #include "chrome/browser/views/extensions/browser_action_overflow_menu_controlle
r.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | |
| 8 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/extensions/extension_context_menu_model.h" | 9 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 11 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| 12 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
| 13 #include "chrome/browser/views/browser_actions_container.h" | 12 #include "chrome/browser/views/browser_actions_container.h" |
| 14 #include "chrome/browser/views/extensions/browser_action_drag_data.h" | 13 #include "chrome/browser/views/extensions/browser_action_drag_data.h" |
| 15 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
| 15 #include "gfx/canvas.h" |
| 16 #include "views/controls/menu/menu_item_view.h" | 16 #include "views/controls/menu/menu_item_view.h" |
| 17 #include "views/controls/menu/menu_2.h" | 17 #include "views/controls/menu/menu_2.h" |
| 18 | 18 |
| 19 BrowserActionOverflowMenuController::BrowserActionOverflowMenuController( | 19 BrowserActionOverflowMenuController::BrowserActionOverflowMenuController( |
| 20 BrowserActionsContainer* owner, | 20 BrowserActionsContainer* owner, |
| 21 views::MenuButton* menu_button, | 21 views::MenuButton* menu_button, |
| 22 const std::vector<BrowserActionView*>& views, | 22 const std::vector<BrowserActionView*>& views, |
| 23 int start_index) | 23 int start_index) |
| 24 : owner_(owner), | 24 : owner_(owner), |
| 25 observer_(NULL), | 25 observer_(NULL), |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 BrowserActionView* BrowserActionOverflowMenuController::ViewForId( | 201 BrowserActionView* BrowserActionOverflowMenuController::ViewForId( |
| 202 int id, size_t* index) { | 202 int id, size_t* index) { |
| 203 // The index of the view being dragged (GetCommand gives a 1-based index into | 203 // The index of the view being dragged (GetCommand gives a 1-based index into |
| 204 // the overflow menu). | 204 // the overflow menu). |
| 205 size_t view_index = owner_->VisibleBrowserActions() + id - 1; | 205 size_t view_index = owner_->VisibleBrowserActions() + id - 1; |
| 206 if (index) | 206 if (index) |
| 207 *index = view_index; | 207 *index = view_index; |
| 208 return owner_->GetBrowserActionViewAt(view_index); | 208 return owner_->GetBrowserActionViewAt(view_index); |
| 209 } | 209 } |
| OLD | NEW |