| 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/win/metro.h" | 8 #include "base/win/metro.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 void NewIncognitoWindow(Browser* browser) { | 53 void NewIncognitoWindow(Browser* browser) { |
| 54 if (base::win::IsMetroProcess()) { | 54 if (base::win::IsMetroProcess()) { |
| 55 NewMetroWindow(browser, browser->profile()->GetOffTheRecordProfile()); | 55 NewMetroWindow(browser, browser->profile()->GetOffTheRecordProfile()); |
| 56 return; | 56 return; |
| 57 } | 57 } |
| 58 NewEmptyWindow(browser->profile()->GetOffTheRecordProfile()); | 58 NewEmptyWindow(browser->profile()->GetOffTheRecordProfile()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void PinCurrentPageToStartScreen(Browser* browser) { | |
| 62 HMODULE metro_module = base::win::GetMetroModule(); | |
| 63 if (metro_module) { | |
| 64 GURL url; | |
| 65 string16 title; | |
| 66 TabContents* tab = chrome::GetActiveTabContents(browser); | |
| 67 bookmark_utils::GetURLAndTitleToBookmark(tab->web_contents(), &url, &title); | |
| 68 | |
| 69 typedef BOOL (*MetroPinUrlToStartScreen)(const string16&, const string16&); | |
| 70 MetroPinUrlToStartScreen metro_pin_url_to_start_screen = | |
| 71 reinterpret_cast<MetroPinUrlToStartScreen>( | |
| 72 ::GetProcAddress(metro_module, "MetroPinUrlToStartScreen")); | |
| 73 if (!metro_pin_url_to_start_screen) { | |
| 74 NOTREACHED(); | |
| 75 return; | |
| 76 } | |
| 77 | |
| 78 VLOG(1) << __FUNCTION__ << " calling pin with title: " << title | |
| 79 << " and url " << UTF8ToUTF16(url.spec()); | |
| 80 metro_pin_url_to_start_screen(title, UTF8ToUTF16(url.spec())); | |
| 81 return; | |
| 82 } | |
| 83 } | |
| 84 | |
| 85 } // namespace chrome | 61 } // namespace chrome |
| 86 | 62 |
| 87 void Browser::SetMetroSnapMode(bool enable) { | 63 void Browser::SetMetroSnapMode(bool enable) { |
| 88 fullscreen_controller_->SetMetroSnapMode(enable); | 64 fullscreen_controller_->SetMetroSnapMode(enable); |
| 89 } | 65 } |
| OLD | NEW |