Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: chrome/browser/chromeos/clock_menu_button.h

Issue 251099: Refactor cros library code into central location and have the UI elements obs... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/clock_menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/clock_menu_button.h
===================================================================
--- chrome/browser/chromeos/clock_menu_button.h (revision 0)
+++ chrome/browser/chromeos/clock_menu_button.h (revision 0)
@@ -0,0 +1,59 @@
+// Copyright (c) 2009 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_CHROMEOS_CLOCK_MENU_BUTTON_H_
+#define CHROME_BROWSER_CHROMEOS_CLOCK_MENU_BUTTON_H_
+
+#include "base/timer.h"
+#include "views/controls/button/menu_button.h"
+#include "views/controls/menu/menu_2.h"
+#include "views/controls/menu/view_menu_delegate.h"
+
+// The clock menu button in the status area.
+// This button shows the current time.
+class ClockMenuButton : public views::MenuButton,
+ public views::ViewMenuDelegate,
+ public views::Menu2Model {
+ public:
+ ClockMenuButton();
+ virtual ~ClockMenuButton() {}
+
+ // views::Menu2Model implementation.
+ virtual bool HasIcons() const { return false; }
+ virtual int GetItemCount() const;
+ virtual views::Menu2Model::ItemType GetTypeAt(int index) const;
+ virtual int GetCommandIdAt(int index) const { return index; }
+ virtual string16 GetLabelAt(int index) const;
+ virtual bool IsLabelDynamicAt(int index) const { return true; }
+ virtual bool GetAcceleratorAt(int index,
+ views::Accelerator* accelerator) const { return false; }
+ virtual bool IsItemCheckedAt(int index) const { return false; }
+ virtual int GetGroupIdAt(int index) const { return 0; }
+ virtual bool GetIconAt(int index, SkBitmap* icon) const { return false; }
+ virtual bool IsEnabledAt(int index) const { return false; }
+ virtual Menu2Model* GetSubmenuModelAt(int index) const { return NULL; }
+ virtual void HighlightChangedTo(int index) {}
+ virtual void ActivatedAt(int index) {}
+ virtual void MenuWillShow() {}
+
+ private:
+ // views::ViewMenuDelegate implementation.
+ virtual void RunMenu(views::View* source, const gfx::Point& pt,
+ gfx::NativeView hwnd);
+
+ // Schedules the timer to fire at the next minute interval.
+ void SetNextTimer();
+
+ // Updates the time on the menu button and sets the next timer.
+ void UpdateText();
+
+ base::OneShotTimer<ClockMenuButton> timer_;
+
+ // The clock menu.
+ views::Menu2 clock_menu_;
+
+ DISALLOW_COPY_AND_ASSIGN(ClockMenuButton);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_CLOCK_MENU_BUTTON_H_
Property changes on: chrome/browser/chromeos/clock_menu_button.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chromeos/clock_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698