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

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

Issue 10546106: TabContentsWrapper -> TabContents, part 53. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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_toolbar_model_delegate.cc ('k') | chrome/browser/ui/browser_window.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"
11 #include "chrome/browser/ui/browser_finder.h" 11 #include "chrome/browser/ui/browser_finder.h"
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents.h"
13 13
14 namespace { 14 namespace {
15 15
16 void NewMetroWindow(Browser* source_browser, Profile* profile) { 16 void NewMetroWindow(Browser* source_browser, Profile* profile) {
17 typedef void (*FlipFrameWindows)(); 17 typedef void (*FlipFrameWindows)();
18 18
19 static FlipFrameWindows flip_window_fn = reinterpret_cast<FlipFrameWindows>( 19 static FlipFrameWindows flip_window_fn = reinterpret_cast<FlipFrameWindows>(
20 ::GetProcAddress(base::win::GetMetroModule(), "FlipFrameWindows")); 20 ::GetProcAddress(base::win::GetMetroModule(), "FlipFrameWindows"));
21 DCHECK(flip_window_fn); 21 DCHECK(flip_window_fn);
22 22
(...skipping 28 matching lines...) Expand all
51 return; 51 return;
52 } 52 }
53 NewEmptyWindow(profile_->GetOffTheRecordProfile()); 53 NewEmptyWindow(profile_->GetOffTheRecordProfile());
54 } 54 }
55 55
56 void Browser::PinCurrentPageToStartScreen() { 56 void Browser::PinCurrentPageToStartScreen() {
57 HMODULE metro_module = base::win::GetMetroModule(); 57 HMODULE metro_module = base::win::GetMetroModule();
58 if (metro_module) { 58 if (metro_module) {
59 GURL url; 59 GURL url;
60 string16 title; 60 string16 title;
61 TabContentsWrapper* tab = GetSelectedTabContentsWrapper(); 61 TabContents* tab = GetActiveTabContents();
62 bookmark_utils::GetURLAndTitleToBookmark(tab->web_contents(), &url, &title); 62 bookmark_utils::GetURLAndTitleToBookmark(tab->web_contents(), &url, &title);
63 63
64 typedef BOOL (*MetroPinUrlToStartScreen)(string16, string16); 64 typedef BOOL (*MetroPinUrlToStartScreen)(string16, string16);
65 MetroPinUrlToStartScreen metro_pin_url_to_start_screen = 65 MetroPinUrlToStartScreen metro_pin_url_to_start_screen =
66 reinterpret_cast<MetroPinUrlToStartScreen>( 66 reinterpret_cast<MetroPinUrlToStartScreen>(
67 ::GetProcAddress(metro_module, "MetroPinUrlToStartScreen")); 67 ::GetProcAddress(metro_module, "MetroPinUrlToStartScreen"));
68 if (!metro_pin_url_to_start_screen) { 68 if (!metro_pin_url_to_start_screen) {
69 NOTREACHED(); 69 NOTREACHED();
70 return; 70 return;
71 } 71 }
72 72
73 VLOG(1) << __FUNCTION__ << " calling pin with title: " << title 73 VLOG(1) << __FUNCTION__ << " calling pin with title: " << title
74 << " and url " << UTF8ToUTF16(url.spec()); 74 << " and url " << UTF8ToUTF16(url.spec());
75 metro_pin_url_to_start_screen(title, UTF8ToUTF16(url.spec())); 75 metro_pin_url_to_start_screen(title, UTF8ToUTF16(url.spec()));
76 return; 76 return;
77 } 77 }
78 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_toolbar_model_delegate.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698