OLD | NEW |
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; | 15 DEFINE_WEB_CONTENTS_USER_DATA_KEY(MetroPinTabHelper) |
16 | 16 |
17 MetroPinTabHelper::MetroPinTabHelper(content::WebContents* web_contents) | 17 MetroPinTabHelper::MetroPinTabHelper(content::WebContents* web_contents) |
18 : content::WebContentsObserver(web_contents), | 18 : content::WebContentsObserver(web_contents), |
19 is_pinned_(false) {} | 19 is_pinned_(false) {} |
20 | 20 |
21 MetroPinTabHelper::~MetroPinTabHelper() {} | 21 MetroPinTabHelper::~MetroPinTabHelper() {} |
22 | 22 |
23 void MetroPinTabHelper::TogglePinnedToStartScreen() { | 23 void MetroPinTabHelper::TogglePinnedToStartScreen() { |
24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
25 HMODULE metro_module = base::win::GetMetroModule(); | 25 HMODULE metro_module = base::win::GetMetroModule(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 return; | 67 return; |
68 } | 68 } |
69 | 69 |
70 GURL url = web_contents()->GetURL(); | 70 GURL url = web_contents()->GetURL(); |
71 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; |
72 VLOG(1) << __FUNCTION__ << " with url " << UTF8ToUTF16(url.spec()) | 72 VLOG(1) << __FUNCTION__ << " with url " << UTF8ToUTF16(url.spec()) |
73 << " result: " << is_pinned_; | 73 << " result: " << is_pinned_; |
74 } | 74 } |
75 #endif | 75 #endif |
76 } | 76 } |
OLD | NEW |