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

Unified Diff: chrome/browser/ui/views/status_icons/status_icon_win.h

Issue 110693004: Moves the notification icon out of the status area overflow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: chrome/browser/ui/views/status_icons/status_icon_win.h
diff --git a/chrome/browser/ui/views/status_icons/status_icon_win.h b/chrome/browser/ui/views/status_icons/status_icon_win.h
index c8e59537f8caa5e0d15b6dab9a435ca5031e1af1..23078f7b11ff917c7a3f4b2ed54815b01ca2b79a 100644
--- a/chrome/browser/ui/views/status_icons/status_icon_win.h
+++ b/chrome/browser/ui/views/status_icons/status_icon_win.h
@@ -1,110 +1,110 @@
-// 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_STATUS_ICONS_STATUS_ICON_WIN_H_
-#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_
-
-#include <windows.h>
-#include <shellapi.h>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/win/scoped_gdi_object.h"
-#include "chrome/browser/status_icons/status_icon.h"
-
-namespace gfx {
-class Point;
-}
-
-namespace views {
-class MenuRunner;
-}
-
-class StatusIconWin : public StatusIcon {
- public:
- // Constructor which provides this icon's unique ID and messaging window.
- StatusIconWin(UINT id, HWND window, UINT message);
- virtual ~StatusIconWin();
-
- // Handles a click event from the user - if |left_button_click| is true and
- // there is a registered observer, passes the click event to the observer,
- // otherwise displays the context menu if there is one.
- void HandleClickEvent(const gfx::Point& cursor_pos, bool left_button_click);
-
- // Handles a click on the balloon from the user.
- void HandleBalloonClickEvent();
-
- // Re-creates the status tray icon now after the taskbar has been created.
- void ResetIcon();
-
- UINT icon_id() const { return icon_id_; }
- UINT message_id() const { return message_id_; }
-
- // Overridden from StatusIcon:
- virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
- virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
- virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE;
- virtual void DisplayBalloon(const gfx::ImageSkia& icon,
- const base::string16& title,
- const base::string16& contents) OVERRIDE;
-
- protected:
- // Overridden from StatusIcon:
- virtual void UpdatePlatformContextMenu(
- StatusIconMenuModel* menu) OVERRIDE;
-
- private:
- void InitIconData(NOTIFYICONDATA* icon_data);
-
- // The unique ID corresponding to this icon.
- UINT icon_id_;
-
- // Window used for processing messages from this icon.
- HWND window_;
-
- // The message identifier used for status icon messages.
- UINT message_id_;
-
- // The currently-displayed icon for the window.
- base::win::ScopedHICON icon_;
-
- // The currently-displayed icon for the notification balloon.
- base::win::ScopedHICON balloon_icon_;
-
- // Not owned.
- ui::MenuModel* menu_model_;
-
- // Context menu associated with this icon (if any).
- scoped_ptr<views::MenuRunner> menu_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(StatusIconWin);
-};
-
-// Implements status notifications using Windows 8 metro style notifications.
-class StatusIconMetro : public StatusIcon {
- public:
- // Constructor which provides this icon's unique ID and messaging window.
- explicit StatusIconMetro(UINT id);
- virtual ~StatusIconMetro();
-
- // Overridden from StatusIcon:
- virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
- virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
- virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE;
- virtual void DisplayBalloon(const gfx::ImageSkia& icon,
- const base::string16& title,
- const base::string16& contents) OVERRIDE;
- protected:
- virtual void UpdatePlatformContextMenu(
- StatusIconMenuModel* menu) OVERRIDE;
-
- private:
- base::string16 tool_tip_;
- const UINT id_;
-
- DISALLOW_COPY_AND_ASSIGN(StatusIconMetro);
-};
-
-#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_
+// 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_STATUS_ICONS_STATUS_ICON_WIN_H_
+#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_
+
+#include <windows.h>
+#include <shellapi.h>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/win/scoped_gdi_object.h"
+#include "chrome/browser/status_icons/status_icon.h"
+
+namespace gfx {
+class Point;
+}
+
+namespace views {
+class MenuRunner;
+}
+
+class StatusIconWin : public StatusIcon {
+ public:
+ // Constructor which provides this icon's unique ID and messaging window.
+ StatusIconWin(UINT id, HWND window, UINT message);
+ virtual ~StatusIconWin();
+
+ // Handles a click event from the user - if |left_button_click| is true and
+ // there is a registered observer, passes the click event to the observer,
+ // otherwise displays the context menu if there is one.
+ void HandleClickEvent(const gfx::Point& cursor_pos, bool left_button_click);
+
+ // Handles a click on the balloon from the user.
+ void HandleBalloonClickEvent();
+
+ // Re-creates the status tray icon now after the taskbar has been created.
+ void ResetIcon();
+
+ UINT icon_id() const { return icon_id_; }
+ HWND hwnd() const { return window_; }
sky 2014/03/19 22:26:39 style guide says accessor and member should match
dewittj 2014/03/20 19:31:08 Done.
+ UINT message_id() const { return message_id_; }
+
+ // Overridden from StatusIcon:
+ virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
+ virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
+ virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE;
+ virtual void DisplayBalloon(const gfx::ImageSkia& icon,
+ const base::string16& title,
+ const base::string16& contents) OVERRIDE;
+
+ protected:
+ // Overridden from StatusIcon:
+ virtual void UpdatePlatformContextMenu(StatusIconMenuModel* menu) OVERRIDE;
+
+ private:
+ void InitIconData(NOTIFYICONDATA* icon_data);
+
+ // The unique ID corresponding to this icon.
+ UINT icon_id_;
+
+ // Window used for processing messages from this icon.
+ HWND window_;
+
+ // The message identifier used for status icon messages.
+ UINT message_id_;
+
+ // The currently-displayed icon for the window.
+ base::win::ScopedHICON icon_;
+
+ // The currently-displayed icon for the notification balloon.
+ base::win::ScopedHICON balloon_icon_;
+
+ // Not owned.
+ ui::MenuModel* menu_model_;
+
+ // Context menu associated with this icon (if any).
+ scoped_ptr<views::MenuRunner> menu_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(StatusIconWin);
+};
+
+// Implements status notifications using Windows 8 metro style notifications.
+class StatusIconMetro : public StatusIcon {
+ public:
+ // Constructor which provides this icon's unique ID and messaging window.
+ explicit StatusIconMetro(UINT id);
+ virtual ~StatusIconMetro();
+
+ // Overridden from StatusIcon:
+ virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
+ virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
+ virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE;
+ virtual void DisplayBalloon(const gfx::ImageSkia& icon,
+ const base::string16& title,
+ const base::string16& contents) OVERRIDE;
+
+ protected:
+ virtual void UpdatePlatformContextMenu(StatusIconMenuModel* menu) OVERRIDE;
+
+ private:
+ base::string16 tool_tip_;
+ const UINT id_;
+
+ DISALLOW_COPY_AND_ASSIGN(StatusIconMetro);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698