<commit_before>// Copyright (c) 2010 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/page_menu_model.h"

#include "app/l10n_util.h"
#include "base/compiler_specific.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/encoding_menu_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"

PageMenuModel::PageMenuModel(menus::SimpleMenuModel::Delegate* delegate,
                             Browser* browser)
    : menus::SimpleMenuModel(delegate), browser_(browser) {
  Build();
}

void PageMenuModel::Build() {
#if !defined(OS_CHROMEOS)
  AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS);
  AddSeparator();
#endif
  AddItemWithStringId(IDC_CUT, IDS_CUT);
  AddItemWithStringId(IDC_COPY, IDS_COPY);
  AddItemWithStringId(IDC_PASTE, IDS_PASTE);
  AddSeparator();
  AddItemWithStringId(IDC_FIND, IDS_FIND);
  AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE);
  AddItemWithStringId(IDC_PRINT, IDS_PRINT);
  AddSeparator();

  zoom_menu_model_.reset(new ZoomMenuModel(delegate()));
  AddSubMenuWithStringId(IDS_ZOOM_MENU, zoom_menu_model_.get());

  encoding_menu_model_.reset(new EncodingMenuModel(browser_));
  AddSubMenuWithStringId(IDS_ENCODING_MENU, encoding_menu_model_.get());

  AddSeparator();
  devtools_menu_model_.reset(new DevToolsMenuModel(delegate()));
  AddSubMenuWithStringId(IDS_DEVELOPER_MENU, devtools_menu_model_.get());

#if !defined(TOOLKIT_GTK)
  // The Report Bug menu hasn't been implemented yet for Linux.
  // Remove it until it is.
  // http://code.google.com/p/chromium/issues/detail?id=11600
  AddSeparator();
  AddItemWithStringId(IDC_REPORT_BUG, IDS_REPORT_BUG);
#endif
}<commit_msg>Unify "create app shortcut" string ids in page menu and main menubar. BUG=41785 TEST=see bug. Review URL: http://codereview.chromium.org/1703001<commit_after>// Copyright (c) 2010 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/page_menu_model.h"

#include "app/l10n_util.h"
#include "base/compiler_specific.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/encoding_menu_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"

PageMenuModel::PageMenuModel(menus::SimpleMenuModel::Delegate* delegate,
                             Browser* browser)
    : menus::SimpleMenuModel(delegate), browser_(browser) {
  Build();
}

void PageMenuModel::Build() {
#if !defined(OS_CHROMEOS)
#if defined(OS_MACOSX)
  AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_APPLICATION_MAC);
#else
  AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS);
#endif
  AddSeparator();
#endif
  AddItemWithStringId(IDC_CUT, IDS_CUT);
  AddItemWithStringId(IDC_COPY, IDS_COPY);
  AddItemWithStringId(IDC_PASTE, IDS_PASTE);
  AddSeparator();
  AddItemWithStringId(IDC_FIND, IDS_FIND);
  AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE);
  AddItemWithStringId(IDC_PRINT, IDS_PRINT);
  AddSeparator();

  zoom_menu_model_.reset(new ZoomMenuModel(delegate()));
  AddSubMenuWithStringId(IDS_ZOOM_MENU, zoom_menu_model_.get());

  encoding_menu_model_.reset(new EncodingMenuModel(browser_));
  AddSubMenuWithStringId(IDS_ENCODING_MENU, encoding_menu_model_.get());

  AddSeparator();
  devtools_menu_model_.reset(new DevToolsMenuModel(delegate()));
  AddSubMenuWithStringId(IDS_DEVELOPER_MENU, devtools_menu_model_.get());

#if !defined(TOOLKIT_GTK)
  // The Report Bug menu hasn't been implemented yet for Linux.
  // Remove it until it is.
  // http://code.google.com/p/chromium/issues/detail?id=11600
  AddSeparator();
  AddItemWithStringId(IDC_REPORT_BUG, IDS_REPORT_BUG);
#endif
}
{'fraction_non_alphanumeric': 0.11270390509144834, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 6.213903743315508, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '951540', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1412, 'n_words': 245}