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

Side by Side Diff: chrome/browser/ui/metro_pin_tab_helper.cc

Issue 10891033: Switch MetroPinTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small clean Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/metro_pin_tab_helper.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/metro_pin_tab_helper.h" 5 #include "chrome/browser/ui/metro_pin_tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 10
11 #if defined(OS_WIN) 11 #if defined(OS_WIN)
12 #include "base/win/metro.h" 12 #include "base/win/metro.h"
13 #endif 13 #endif
14 14
15 int MetroPinTabHelper::kUserDataKey;
16
15 MetroPinTabHelper::MetroPinTabHelper(content::WebContents* web_contents) 17 MetroPinTabHelper::MetroPinTabHelper(content::WebContents* web_contents)
16 : content::WebContentsObserver(web_contents), 18 : content::WebContentsObserver(web_contents),
17 is_pinned_(false) {} 19 is_pinned_(false) {}
18 20
19 MetroPinTabHelper::~MetroPinTabHelper() {} 21 MetroPinTabHelper::~MetroPinTabHelper() {}
20 22
21 void MetroPinTabHelper::TogglePinnedToStartScreen() { 23 void MetroPinTabHelper::TogglePinnedToStartScreen() {
22 #if defined(OS_WIN) 24 #if defined(OS_WIN)
23 HMODULE metro_module = base::win::GetMetroModule(); 25 HMODULE metro_module = base::win::GetMetroModule();
24 if (metro_module) { 26 if (metro_module) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return; 67 return;
66 } 68 }
67 69
68 GURL url = web_contents()->GetURL(); 70 GURL url = web_contents()->GetURL();
69 is_pinned_ = metro_is_pinned_to_start_screen(UTF8ToUTF16(url.spec())) != 0; 71 is_pinned_ = metro_is_pinned_to_start_screen(UTF8ToUTF16(url.spec())) != 0;
70 VLOG(1) << __FUNCTION__ << " with url " << UTF8ToUTF16(url.spec()) 72 VLOG(1) << __FUNCTION__ << " with url " << UTF8ToUTF16(url.spec())
71 << " result: " << is_pinned_; 73 << " result: " << is_pinned_;
72 } 74 }
73 #endif 75 #endif
74 } 76 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/metro_pin_tab_helper.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698