| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/back_forward_menu_model_gtk.h" | 5 #include "chrome/browser/gtk/back_forward_menu_model_gtk.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/gtk/back_forward_button_gtk.h" | 8 #include "chrome/browser/gtk/back_forward_button_gtk.h" |
| 9 | 9 |
| 10 // static | |
| 11 BackForwardMenuModel* BackForwardMenuModel::Create(Browser* browser, | |
| 12 ModelType model_type) { | |
| 13 return new BackForwardMenuModelGtk(browser, model_type, NULL); | |
| 14 } | |
| 15 | |
| 16 BackForwardMenuModelGtk::BackForwardMenuModelGtk(Browser* browser, | 10 BackForwardMenuModelGtk::BackForwardMenuModelGtk(Browser* browser, |
| 17 ModelType model_type, | 11 ModelType model_type, |
| 18 BackForwardButtonGtk* button) | 12 BackForwardButtonGtk* button) |
| 19 : button_(button) { | 13 : BackForwardMenuModel(browser, model_type), |
| 20 browser_ = browser; | 14 button_(button) { |
| 21 model_type_ = model_type; | |
| 22 } | 15 } |
| 23 | 16 |
| 24 int BackForwardMenuModelGtk::GetItemCount() const { | 17 int BackForwardMenuModelGtk::GetItemCount() const { |
| 25 return GetTotalItemCount(); | 18 return GetTotalItemCount(); |
| 26 } | 19 } |
| 27 | 20 |
| 28 bool BackForwardMenuModelGtk::IsItemSeparator(int command_id) const { | 21 bool BackForwardMenuModelGtk::IsItemSeparator(int command_id) const { |
| 29 return IsSeparator(command_id); | 22 return IsSeparator(command_id); |
| 30 } | 23 } |
| 31 | 24 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 46 } | 39 } |
| 47 | 40 |
| 48 void BackForwardMenuModelGtk::ExecuteCommand(int command_id) { | 41 void BackForwardMenuModelGtk::ExecuteCommand(int command_id) { |
| 49 ExecuteCommandById(command_id); | 42 ExecuteCommandById(command_id); |
| 50 } | 43 } |
| 51 | 44 |
| 52 void BackForwardMenuModelGtk::StoppedShowing() { | 45 void BackForwardMenuModelGtk::StoppedShowing() { |
| 53 if (button_) | 46 if (button_) |
| 54 button_->StoppedShowingMenu(); | 47 button_->StoppedShowingMenu(); |
| 55 } | 48 } |
| OLD | NEW |