| Index: chrome/browser/ui/views/location_bar/translate_icon_view.cc
|
| diff --git a/chrome/browser/ui/views/location_bar/translate_icon_view.cc b/chrome/browser/ui/views/location_bar/translate_icon_view.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a059f4106056b214f6295ceb8f48f3d6fb43c754
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/location_bar/translate_icon_view.cc
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2013 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/ui/views/location_bar/translate_icon_view.h"
|
| +
|
| +#include "base/strings/utf_string_conversions.h"
|
| +#include "chrome/app/chrome_command_ids.h"
|
| +#include "chrome/browser/ui/browser_commands.h"
|
| +#include "chrome/browser/ui/view_ids.h"
|
| +#include "chrome/browser/ui/views/location_bar/bubble_icon_view_delegate.h"
|
| +#include "chrome/browser/ui/views/translate/translate_bubble_view.h"
|
| +#include "grit/generated_resources.h"
|
| +#include "grit/theme_resources.h"
|
| +#include "ui/base/l10n/l10n_util.h"
|
| +#include "ui/base/resource/resource_bundle.h"
|
| +
|
| +namespace {
|
| +
|
| +class BubbleIconViewDelegateImpl : public BubbleIconViewDelegate {
|
| + public:
|
| + BubbleIconViewDelegateImpl() {
|
| + }
|
| +
|
| + virtual bool IsBubbleShowing() const OVERRIDE {
|
| + return TranslateBubbleView::IsShowing();
|
| + }
|
| +
|
| + virtual void OnExecutingByMouse() OVERRIDE {
|
| + }
|
| +
|
| + virtual void OnExecutingByKey() OVERRIDE {
|
| + }
|
| +
|
| + virtual void OnExecutingByGesture() OVERRIDE {
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(BubbleIconViewDelegateImpl);
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +TranslateIconView::TranslateIconView(CommandUpdater* command_updater)
|
| + : BubbleIconView(command_updater, IDC_TRANSLATE_PAGE) {
|
| + delegate_.reset(new BubbleIconViewDelegateImpl);
|
| + set_delegate(delegate_.get());
|
| +
|
| + set_id(VIEW_ID_TRANSLATE_BUTTON);
|
| + SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TRANSLATE));
|
| + SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
|
| + IDR_TRANSLATE));
|
| +}
|
| +
|
| +TranslateIconView::~TranslateIconView() {
|
| +}
|
|
|