| 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 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 25 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "content/public/browser/browser_accessibility_state.h" | 28 #include "content/public/browser/browser_accessibility_state.h" |
| 29 #include "content/public/browser/page_navigator.h" | 29 #include "content/public/browser/page_navigator.h" |
| 30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| 31 #include "content/public/common/page_transition_types.h" | 31 #include "content/public/common/page_transition_types.h" |
| 32 #include "googleurl/src/gurl.h" | 32 #include "googleurl/src/gurl.h" |
| 33 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
| 34 #include "grit/theme_resources.h" | 34 #include "grit/theme_resources.h" |
| 35 #include "ui/base/layout.h" |
| 35 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 36 #include "ui/base/models/simple_menu_model.h" | 37 #include "ui/base/models/simple_menu_model.h" |
| 37 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
| 38 #include "ui/base/theme_provider.h" | 39 #include "ui/base/theme_provider.h" |
| 39 #include "ui/gfx/font.h" | 40 #include "ui/gfx/font.h" |
| 40 #include "ui/views/controls/menu/native_menu_win.h" | 41 #include "ui/views/controls/menu/native_menu_win.h" |
| 41 #include "ui/views/views_delegate.h" | 42 #include "ui/views/views_delegate.h" |
| 42 #include "ui/views/widget/native_widget_win.h" | 43 #include "ui/views/widget/native_widget_win.h" |
| 43 #include "ui/views/widget/widget.h" | 44 #include "ui/views/widget/widget.h" |
| 44 #include "ui/views/window/non_client_view.h" | 45 #include "ui/views/window/non_client_view.h" |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 //////////////////////////////////////////////////////////////////////////////// | 606 //////////////////////////////////////////////////////////////////////////////// |
| 606 // BrowserFrame, public: | 607 // BrowserFrame, public: |
| 607 | 608 |
| 608 // static | 609 // static |
| 609 const gfx::Font& BrowserFrame::GetTitleFont() { | 610 const gfx::Font& BrowserFrame::GetTitleFont() { |
| 610 static gfx::Font* title_font = | 611 static gfx::Font* title_font = |
| 611 new gfx::Font(views::NativeWidgetWin::GetWindowTitleFont()); | 612 new gfx::Font(views::NativeWidgetWin::GetWindowTitleFont()); |
| 612 return *title_font; | 613 return *title_font; |
| 613 } | 614 } |
| 614 | 615 |
| 616 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { |
| 617 if (base::win::IsMetroProcess()) { |
| 618 if (ui::GetDisplayLayout() == ui::LAYOUT_DESKTOP) |
| 619 return false; |
| 620 } |
| 621 return !IsMaximized(); |
| 622 } |
| 623 |
| 615 //////////////////////////////////////////////////////////////////////////////// | 624 //////////////////////////////////////////////////////////////////////////////// |
| 616 // NativeBrowserFrame, public: | 625 // NativeBrowserFrame, public: |
| 617 | 626 |
| 618 // static | 627 // static |
| 619 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | 628 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( |
| 620 BrowserFrame* browser_frame, | 629 BrowserFrame* browser_frame, |
| 621 BrowserView* browser_view) { | 630 BrowserView* browser_view) { |
| 622 return new BrowserFrameWin(browser_frame, browser_view); | 631 return new BrowserFrameWin(browser_frame, browser_view); |
| 623 } | 632 } |
| OLD | NEW |