Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1097)

Unified Diff: chrome/browser/gtk/back_forward_menu_model_gtk.cc

Issue 501168: Make back forward menu model a MenuModel.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/gtk/back_forward_menu_model_gtk.cc
===================================================================
--- chrome/browser/gtk/back_forward_menu_model_gtk.cc (revision 35347)
+++ chrome/browser/gtk/back_forward_menu_model_gtk.cc (working copy)
@@ -1,60 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/gtk/back_forward_menu_model_gtk.h"
-
-#include "app/l10n_util.h"
-#include "base/string_util.h"
-#include "chrome/browser/gtk/back_forward_button_gtk.h"
-
-// Might want to vary this by locale.
-static const size_t kMaxChars = 50;
-
-BackForwardMenuModelGtk::BackForwardMenuModelGtk(Browser* browser,
- ModelType model_type,
- BackForwardButtonGtk* button)
- : BackForwardMenuModel(browser, model_type),
- button_(button) {
-}
-
-int BackForwardMenuModelGtk::GetItemCount() const {
- return GetTotalItemCount();
-}
-
-bool BackForwardMenuModelGtk::IsItemSeparator(int command_id) const {
- return IsSeparator(command_id);
-}
-
-std::string BackForwardMenuModelGtk::GetLabel(int command_id) const {
- std::wstring item_label_wstr = UTF16ToWideHack(GetItemLabel(command_id));
- // This breaks on word boundaries. Ideally we would break on character
- // boundaries.
- item_label_wstr = l10n_util::TruncateString(item_label_wstr, kMaxChars);
- return WideToUTF8(item_label_wstr);
-}
-
-bool BackForwardMenuModelGtk::HasIcon(int command_id) const {
- return ItemHasIcon(command_id);
-}
-
-const SkBitmap* BackForwardMenuModelGtk::GetIcon(int command_id) const {
- return &GetItemIcon(command_id);
-}
-
-bool BackForwardMenuModelGtk::IsCommandEnabled(int command_id) const {
- return ItemHasCommand(command_id);
-}
-
-void BackForwardMenuModelGtk::ExecuteCommand(int command_id) {
- ExecuteCommandById(command_id);
-}
-
-void BackForwardMenuModelGtk::StoppedShowing() {
- if (button_)
- button_->StoppedShowingMenu();
-}
-
-bool BackForwardMenuModelGtk::AlwaysShowImages() const {
- return true;
-}

Powered by Google App Engine
This is Rietveld 408576698