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

Unified Diff: chrome/browser/ui/metro_pin_tab_helper.h

Issue 10800054: Add pin icon to the omnibar in windows 8 metro mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/metro_pin_tab_helper.h
diff --git a/chrome/browser/ui/metro_pin_tab_helper.h b/chrome/browser/ui/metro_pin_tab_helper.h
index c72e503236209ea9eb48a5f37c71b16d2b93737e..6700773c13c2f3d8145cfc824c1e5d551ca3b480 100644
--- a/chrome/browser/ui/metro_pin_tab_helper.h
+++ b/chrome/browser/ui/metro_pin_tab_helper.h
@@ -10,11 +10,23 @@
// Per-tab class to help manage metro pinning.
class MetroPinTabHelper : public content::WebContentsObserver {
public:
- explicit MetroPinTabHelper(content::WebContents* tab_contents);
+ // Objects implement this interface to get notified about changes in the
+ // metro pinned state.
+ class Delegate {
sky 2012/07/20 16:46:41 Move this into its own file.
benwells 2012/07/23 08:03:43 Done.
+ public:
+ // Notification that the pinned state of the current URL changed.
+ virtual void IsPinnedChanged(content::WebContents* source, bool pinned) = 0;
+
+ protected:
+ virtual ~Delegate();
+ };
+ explicit MetroPinTabHelper(content::WebContents* web_contents);
virtual ~MetroPinTabHelper();
bool is_pinned() const { return is_pinned_; }
+ void set_delegate(Delegate* delegate) { delegate_ = delegate; }
+
void TogglePinnedToStartScreen();
// content::WebContentsObserver overrides:
@@ -26,9 +38,15 @@ class MetroPinTabHelper : public content::WebContentsObserver {
// Queries the metro driver about the pinned state of the current URL.
void UpdatePinnedStateForCurrentURL();
+ // Update the pinned state and notify the delegate.
+ void SetIsPinned(bool is_pinned);
+
// Whether the current URL is pinned to the metro start screen.
bool is_pinned_;
+ // The delegate that we inform when the is_pinned_ state changes.
+ Delegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(MetroPinTabHelper);
};

Powered by Google App Engine
This is Rietveld 408576698