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/views/frame/browser_frame_win.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 using content::OpenURLParams; | 58 using content::OpenURLParams; |
59 using content::Referrer; | 59 using content::Referrer; |
60 using content::WebContents; | 60 using content::WebContents; |
61 | 61 |
62 #if !defined(USE_AURA) | 62 #if !defined(USE_AURA) |
63 extern "C" { | 63 extern "C" { |
64 // Windows metro exported functions from metro_driver. | 64 // Windows metro exported functions from metro_driver. |
65 typedef void (*SetFrameWindow)(HWND window); | 65 typedef void (*SetFrameWindow)(HWND window); |
66 typedef void (*CloseFrameWindow)(HWND window); | 66 typedef void (*CloseFrameWindow)(HWND window); |
67 typedef void (*FlipFrameWindows)(); | 67 typedef void (*FlipFrameWindows)(); |
| 68 typedef void (*MetroSetFullscreen)(bool fullscreen); |
68 } | 69 } |
69 #endif // USE_AURA | 70 #endif // USE_AURA |
70 | 71 |
71 views::Button* MakeWindowSwitcherButton(views::ButtonListener* listener, | 72 views::Button* MakeWindowSwitcherButton(views::ButtonListener* listener, |
72 bool is_off_the_record) { | 73 bool is_off_the_record) { |
73 views::ImageButton* switcher_button = new views::ImageButton(listener); | 74 views::ImageButton* switcher_button = new views::ImageButton(listener); |
74 // The button in the incognito window has the hot-cold images inverted | 75 // The button in the incognito window has the hot-cold images inverted |
75 // with respect to the regular browser window. | 76 // with respect to the regular browser window. |
76 switcher_button->SetImage( | 77 switcher_button->SetImage( |
77 views::ImageButton::BS_NORMAL, | 78 views::ImageButton::BS_NORMAL, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 283 |
283 views::NativeWidgetWin::FrameTypeChanged(); | 284 views::NativeWidgetWin::FrameTypeChanged(); |
284 | 285 |
285 // In Windows 8 metro mode we call Show on the BrowserFrame instance to | 286 // In Windows 8 metro mode we call Show on the BrowserFrame instance to |
286 // ensure that the window can be styled appropriately, i.e. no sysmenu, | 287 // ensure that the window can be styled appropriately, i.e. no sysmenu, |
287 // etc. | 288 // etc. |
288 if (base::win::IsMetroProcess()) | 289 if (base::win::IsMetroProcess()) |
289 Show(); | 290 Show(); |
290 } | 291 } |
291 | 292 |
| 293 void BrowserFrameWin::SetFullscreen(bool fullscreen) { |
| 294 if (base::win::IsMetroProcess()) { |
| 295 HMODULE metro = base::win::GetMetroModule(); |
| 296 if (metro) { |
| 297 MetroSetFullscreen set_full_screen = reinterpret_cast<MetroSetFullscreen>( |
| 298 ::GetProcAddress(metro, "SetFullscreen")); |
| 299 DCHECK(set_full_screen); |
| 300 if (set_full_screen) |
| 301 set_full_screen(fullscreen); |
| 302 } else { |
| 303 NOTREACHED() << "Failed to get metro driver module"; |
| 304 } |
| 305 } |
| 306 views::NativeWidgetWin::SetFullscreen(fullscreen); |
| 307 } |
| 308 |
292 | 309 |
293 //////////////////////////////////////////////////////////////////////////////// | 310 //////////////////////////////////////////////////////////////////////////////// |
294 // BrowserFrameWin, NativeBrowserFrame implementation: | 311 // BrowserFrameWin, NativeBrowserFrame implementation: |
295 | 312 |
296 views::NativeWidget* BrowserFrameWin::AsNativeWidget() { | 313 views::NativeWidget* BrowserFrameWin::AsNativeWidget() { |
297 return this; | 314 return this; |
298 } | 315 } |
299 | 316 |
300 const views::NativeWidget* BrowserFrameWin::AsNativeWidget() const { | 317 const views::NativeWidget* BrowserFrameWin::AsNativeWidget() const { |
301 return this; | 318 return this; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 602 |
586 //////////////////////////////////////////////////////////////////////////////// | 603 //////////////////////////////////////////////////////////////////////////////// |
587 // NativeBrowserFrame, public: | 604 // NativeBrowserFrame, public: |
588 | 605 |
589 // static | 606 // static |
590 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | 607 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( |
591 BrowserFrame* browser_frame, | 608 BrowserFrame* browser_frame, |
592 BrowserView* browser_view) { | 609 BrowserView* browser_view) { |
593 return new BrowserFrameWin(browser_frame, browser_view); | 610 return new BrowserFrameWin(browser_frame, browser_view); |
594 } | 611 } |
OLD | NEW |