| Index: chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| index 6f5e608d7e244f07a7c6e8f31456c952ba70add2..4798ecb571fb79c95032ba6319686b283f77476a 100644
|
| --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
|
| @@ -42,6 +42,7 @@
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/profiling.h"
|
| #include "content/public/browser/host_zoom_map.h"
|
| +#include "content/public/browser/navigation_entry.h"
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/notification_source.h"
|
| #include "content/public/browser/notification_types.h"
|
| @@ -54,6 +55,7 @@
|
| #include "ui/base/layout.h"
|
| #include "ui/base/models/button_menu_item_model.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/base/touch/touch_factory.h"
|
| #include "ui/gfx/image/image.h"
|
| #include "ui/gfx/image/image_skia.h"
|
|
|
| @@ -361,6 +363,15 @@ bool WrenchMenuModel::IsCommandIdChecked(int command_id) const {
|
| return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar);
|
| } else if (command_id == IDC_PROFILING_ENABLED) {
|
| return Profiling::BeingProfiled();
|
| + } else if (command_id == IDC_TOGGLE_REQUEST_TABLET_SITE) {
|
| + WebContents* current_tab = chrome::GetActiveWebContents(browser_);
|
| + if (!current_tab)
|
| + return false;
|
| + content::NavigationEntry* entry =
|
| + current_tab->GetController().GetActiveEntry();
|
| + if (!entry)
|
| + return false;
|
| + return entry->GetIsOverridingUserAgent();
|
| }
|
|
|
| return false;
|
| @@ -505,6 +516,23 @@ void WrenchMenuModel::Build() {
|
|
|
| AddItemWithStringId(IDC_OPTIONS, IDS_SETTINGS);
|
|
|
| +#if defined(OS_CHROMEOS)
|
| + // Note: on Chromebooks with default to "Desktop Site" even for
|
| + // Chromebooks with a touch screen.
|
| + // The following toggle lets the user switch to
|
| + // "Tablet Site". This functionality is under two flags:
|
| + // - to turn in on only for touch devices (intended use)
|
| + // - to turn it on regardless of touch device (for testing)
|
| + bool enable_flag = CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableRequestTabletSite);
|
| + bool force_flag = CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableRequestTabletSiteEvenIfNonTouchDevice);
|
| + if (force_flag ||
|
| + (enable_flag && ui::TouchFactory::GetInstance()->IsTouchDevicePresent()))
|
| + AddCheckItemWithStringId(IDC_TOGGLE_REQUEST_TABLET_SITE,
|
| + IDS_TOGGLE_REQUEST_TABLET_SITE);
|
| +#endif
|
| +
|
| if (!is_touch_menu) {
|
| AddItem(IDC_ABOUT, l10n_util::GetStringUTF16(IDS_ABOUT));
|
| string16 num_background_pages = base::FormatNumber(
|
|
|