Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h |
| diff --git a/chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h b/chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5dda44784ae517345af47358c64c7aa7c76ff436 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright (c) 2012 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. |
| + |
| +#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ |
| +#pragma once |
| + |
| +#include "chrome/browser/command_updater.h" |
| +#include "ui/views/controls/image_view.h" |
| + |
| +class LocationBarView; |
| + |
| +namespace views { |
| +class KeyEvent; |
| +class MouseEvent; |
| +} |
| + |
| +// A Page Action image view for Chrome to Mobile functionality. |
| +class ChromeToMobileView : public views::ImageView, |
| + public CommandUpdater::CommandObserver { |
| + public: |
| + explicit ChromeToMobileView(LocationBarView* location_bar_view, |
|
sky
2012/03/11 21:41:22
no explicit.
msw
2012/03/12 10:17:18
Done.
|
| + CommandUpdater* command_updater); |
| + virtual ~ChromeToMobileView(); |
| + |
| + // CommandUpdater::CommandObserver overrides: |
| + virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; |
| + |
| + private: |
| + // views::ImageView overrides: |
| + virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| + virtual bool GetTooltipText(const gfx::Point& p, |
| + string16* tooltip) const OVERRIDE; |
| + virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
| + virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
| + virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
| + |
| + // The LocationBarView hosting this view. |
| + LocationBarView* location_bar_view_; |
| + |
| + // The CommandUpdater for the Browser object that owns the location bar. |
| + CommandUpdater* command_updater_; |
| + |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeToMobileView); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ |