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 18 matching lines...) Expand all Loading... |
29 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
30 #include "content/public/common/page_transition_types.h" | 30 #include "content/public/common/page_transition_types.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "grit/theme_resources.h" | 32 #include "grit/theme_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
34 #include "ui/base/layout.h" | 34 #include "ui/base/layout.h" |
35 #include "ui/base/models/simple_menu_model.h" | 35 #include "ui/base/models/simple_menu_model.h" |
36 #include "ui/base/resource/resource_bundle.h" | 36 #include "ui/base/resource/resource_bundle.h" |
37 #include "ui/base/theme_provider.h" | 37 #include "ui/base/theme_provider.h" |
38 #include "ui/base/window_open_disposition.h" | 38 #include "ui/base/window_open_disposition.h" |
39 #include "ui/gfx/font.h" | |
40 #include "ui/gfx/win/dpi.h" | 39 #include "ui/gfx/win/dpi.h" |
41 #include "ui/views/controls/menu/native_menu_win.h" | 40 #include "ui/views/controls/menu/native_menu_win.h" |
42 #include "ui/views/views_delegate.h" | 41 #include "ui/views/views_delegate.h" |
43 #include "ui/views/widget/native_widget_win.h" | 42 #include "ui/views/widget/native_widget_win.h" |
44 #include "ui/views/widget/widget.h" | 43 #include "ui/views/widget/widget.h" |
45 #include "ui/views/window/non_client_view.h" | 44 #include "ui/views/window/non_client_view.h" |
46 #include "url/gurl.h" | 45 #include "url/gurl.h" |
47 #include "win8/util/win8_util.h" | 46 #include "win8/util/win8_util.h" |
48 | 47 |
49 #pragma comment(lib, "dwmapi.lib") | 48 #pragma comment(lib, "dwmapi.lib") |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); | 500 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); |
502 DCHECK(current_tab); | 501 DCHECK(current_tab); |
503 | 502 |
504 current_tab_info->url = base::win::LocalAllocAndCopyString( | 503 current_tab_info->url = base::win::LocalAllocAndCopyString( |
505 UTF8ToWide(current_tab->GetURL().spec())); | 504 UTF8ToWide(current_tab->GetURL().spec())); |
506 } | 505 } |
507 | 506 |
508 //////////////////////////////////////////////////////////////////////////////// | 507 //////////////////////////////////////////////////////////////////////////////// |
509 // BrowserFrame, public: | 508 // BrowserFrame, public: |
510 | 509 |
511 // static | |
512 const gfx::Font& BrowserFrame::GetTitleFont() { | |
513 static gfx::Font* title_font = | |
514 new gfx::Font(views::NativeWidgetWin::GetWindowTitleFont()); | |
515 return *title_font; | |
516 } | |
517 | |
518 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { | 510 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { |
519 if (win8::IsSingleWindowMetroMode()) { | 511 if (win8::IsSingleWindowMetroMode()) { |
520 if (ui::GetDisplayLayout() == ui::LAYOUT_DESKTOP) | 512 if (ui::GetDisplayLayout() == ui::LAYOUT_DESKTOP) |
521 return false; | 513 return false; |
522 } | 514 } |
523 return !IsMaximized(); | 515 return !IsMaximized(); |
524 } | 516 } |
OLD | NEW |