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

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

Issue 10446106: Preliminary metro snap plumbing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Aura compile fixes. 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
« no previous file with comments | « chrome/browser/ui/browser.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.h" 12 #include "chrome/browser/ui/fullscreen_controller.h"
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
13 14
14 namespace { 15 namespace {
15 16
16 void NewMetroWindow(Browser* source_browser, Profile* profile) { 17 void NewMetroWindow(Browser* source_browser, Profile* profile) {
17 typedef void (*FlipFrameWindows)(); 18 typedef void (*FlipFrameWindows)();
18 19
19 static FlipFrameWindows flip_window_fn = reinterpret_cast<FlipFrameWindows>( 20 static FlipFrameWindows flip_window_fn = reinterpret_cast<FlipFrameWindows>(
20 ::GetProcAddress(base::win::GetMetroModule(), "FlipFrameWindows")); 21 ::GetProcAddress(base::win::GetMetroModule(), "FlipFrameWindows"));
21 DCHECK(flip_window_fn); 22 DCHECK(flip_window_fn);
22 23
(...skipping 23 matching lines...) Expand all
46 } 47 }
47 48
48 void Browser::NewIncognitoWindow() { 49 void Browser::NewIncognitoWindow() {
49 if (base::win::GetMetroModule()) { 50 if (base::win::GetMetroModule()) {
50 NewMetroWindow(this, profile_->GetOffTheRecordProfile()); 51 NewMetroWindow(this, profile_->GetOffTheRecordProfile());
51 return; 52 return;
52 } 53 }
53 NewEmptyWindow(profile_->GetOffTheRecordProfile()); 54 NewEmptyWindow(profile_->GetOffTheRecordProfile());
54 } 55 }
55 56
57 void Browser::SetMetroSnapMode(bool enable) {
58 fullscreen_controller_->SetMetroSnapMode(enable);
59 }
60
56 void Browser::PinCurrentPageToStartScreen() { 61 void Browser::PinCurrentPageToStartScreen() {
57 HMODULE metro_module = base::win::GetMetroModule(); 62 HMODULE metro_module = base::win::GetMetroModule();
58 if (metro_module) { 63 if (metro_module) {
59 GURL url; 64 GURL url;
60 string16 title; 65 string16 title;
61 TabContents* tab = GetActiveTabContents(); 66 TabContents* tab = GetActiveTabContents();
62 bookmark_utils::GetURLAndTitleToBookmark(tab->web_contents(), &url, &title); 67 bookmark_utils::GetURLAndTitleToBookmark(tab->web_contents(), &url, &title);
63 68
64 typedef BOOL (*MetroPinUrlToStartScreen)(string16, string16); 69 typedef BOOL (*MetroPinUrlToStartScreen)(string16, string16);
65 MetroPinUrlToStartScreen metro_pin_url_to_start_screen = 70 MetroPinUrlToStartScreen metro_pin_url_to_start_screen =
66 reinterpret_cast<MetroPinUrlToStartScreen>( 71 reinterpret_cast<MetroPinUrlToStartScreen>(
67 ::GetProcAddress(metro_module, "MetroPinUrlToStartScreen")); 72 ::GetProcAddress(metro_module, "MetroPinUrlToStartScreen"));
68 if (!metro_pin_url_to_start_screen) { 73 if (!metro_pin_url_to_start_screen) {
69 NOTREACHED(); 74 NOTREACHED();
70 return; 75 return;
71 } 76 }
72 77
73 VLOG(1) << __FUNCTION__ << " calling pin with title: " << title 78 VLOG(1) << __FUNCTION__ << " calling pin with title: " << title
74 << " and url " << UTF8ToUTF16(url.spec()); 79 << " and url " << UTF8ToUTF16(url.spec());
75 metro_pin_url_to_start_screen(title, UTF8ToUTF16(url.spec())); 80 metro_pin_url_to_start_screen(title, UTF8ToUTF16(url.spec()));
76 return; 81 return;
77 } 82 }
78 } 83 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698