diff options
author | avayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 23:06:34 +0000 |
---|---|---|
committer | avayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 23:06:34 +0000 |
commit | c2d602b32d86c44e6eb1fe6b1d12fda314e21a62 (patch) | |
tree | 899d04cc3db6a9143d6073cf0774912ae645ea33 /chrome/browser/views/star_toggle.h | |
parent | cce95d69e3957b1e5d9762febd4889ff94f7e7fd (diff) | |
download | chromium_src-c2d602b32d86c44e6eb1fe6b1d12fda314e21a62.zip chromium_src-c2d602b32d86c44e6eb1fe6b1d12fda314e21a62.tar.gz chromium_src-c2d602b32d86c44e6eb1fe6b1d12fda314e21a62.tar.bz2 |
Added Star button to compact navigation mode.
BUG=32326
TEST=Switch Chrome to compact mode by pressing Ctrl-Shift-C. Test that Star
icon works.
Review URL: http://codereview.chromium.org/577026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/star_toggle.h')
-rw-r--r-- | chrome/browser/views/star_toggle.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/chrome/browser/views/star_toggle.h b/chrome/browser/views/star_toggle.h deleted file mode 100644 index 1cfc0de..0000000 --- a/chrome/browser/views/star_toggle.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2006-2008 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_VIEWS_STAR_TOGGLE_H_ -#define CHROME_BROWSER_VIEWS_STAR_TOGGLE_H_ - -#include "views/view.h" -#include "views/event.h" - -class SkBitmap; - -//////////////////////////////////////////////////////////////////////////////// -// -// A view subclass to implement the star button. The star button notifies its -// Delegate when the state changes. -// -//////////////////////////////////////////////////////////////////////////////// -class StarToggle : public views::View { - public: - class Delegate { - public: - // Called when the star is toggled. - virtual void StarStateChanged(bool state) = 0; - }; - - explicit StarToggle(Delegate* delegate); - virtual ~StarToggle(); - - // Set whether the star is checked. - void SetState(bool s); - bool GetState() const; - - // If true (the default) the state is immediately changed on a mouse release. - // If false, on mouse release the delegate is notified, but the state is not - // changed. - void set_change_state_immediately(bool value) { - change_state_immediately_ = value; - } - - // Check/uncheck the star. - void SwitchState(); - - // Overriden from view. - void Paint(gfx::Canvas* canvas); - gfx::Size GetPreferredSize(); - virtual bool OnMousePressed(const views::MouseEvent& e); - virtual bool OnMouseDragged(const views::MouseEvent& event); - virtual void OnMouseReleased(const views::MouseEvent& e, bool canceled); - bool OnKeyPressed(const views::KeyEvent& e); - - private: - // The state. - bool state_; - - // Our bitmap. - SkBitmap* state_off_; - SkBitmap* state_on_; - - // Parent to be notified. - Delegate* delegate_; - - // See note in setter. - bool change_state_immediately_; - - DISALLOW_EVIL_CONSTRUCTORS(StarToggle); -}; - -#endif // CHROME_BROWSER_VIEWS_STAR_TOGGLE_H_ |