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

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

Issue 10801006: Allow secondary tiles to be unpinned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove NULL check 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/metro_pin_tab_helper.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/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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/metro_pin_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698