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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 511 |
512 // We allocate memory for the title and url via LocalAlloc. The caller has to | 512 // We allocate memory for the title and url via LocalAlloc. The caller has to |
513 // free the memory via LocalFree. | 513 // free the memory via LocalFree. |
514 current_tab_info->title = base::win::LocalAllocAndCopyString( | 514 current_tab_info->title = base::win::LocalAllocAndCopyString( |
515 browser->GetWindowTitleForCurrentTab()); | 515 browser->GetWindowTitleForCurrentTab()); |
516 | 516 |
517 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); | 517 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); |
518 DCHECK(current_tab); | 518 DCHECK(current_tab); |
519 | 519 |
520 current_tab_info->url = base::win::LocalAllocAndCopyString( | 520 current_tab_info->url = base::win::LocalAllocAndCopyString( |
521 UTF8ToWide(current_tab->GetURL().spec())); | 521 base::UTF8ToWide(current_tab->GetURL().spec())); |
522 } | 522 } |
523 | 523 |
524 //////////////////////////////////////////////////////////////////////////////// | 524 //////////////////////////////////////////////////////////////////////////////// |
525 // BrowserFrame, public: | 525 // BrowserFrame, public: |
526 | 526 |
527 // static | 527 // static |
528 const gfx::Font& BrowserFrame::GetTitleFont() { | 528 const gfx::Font& BrowserFrame::GetTitleFont() { |
529 static gfx::Font* title_font = | 529 static gfx::Font* title_font = |
530 new gfx::Font(views::NativeWidgetWin::GetWindowTitleFont()); | 530 new gfx::Font(views::NativeWidgetWin::GetWindowTitleFont()); |
531 return *title_font; | 531 return *title_font; |
532 } | 532 } |
533 | 533 |
534 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { | 534 bool BrowserFrame::ShouldLeaveOffsetNearTopBorder() { |
535 if (win8::IsSingleWindowMetroMode()) { | 535 if (win8::IsSingleWindowMetroMode()) { |
536 if (ui::GetDisplayLayout() == ui::LAYOUT_DESKTOP) | 536 if (ui::GetDisplayLayout() == ui::LAYOUT_DESKTOP) |
537 return false; | 537 return false; |
538 } | 538 } |
539 return !IsMaximized(); | 539 return !IsMaximized(); |
540 } | 540 } |
541 | 541 |
542 //////////////////////////////////////////////////////////////////////////////// | 542 //////////////////////////////////////////////////////////////////////////////// |
543 // NativeBrowserFrame, public: | 543 // NativeBrowserFrame, public: |
544 | 544 |
545 // static | 545 // static |
546 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | 546 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( |
547 BrowserFrame* browser_frame, | 547 BrowserFrame* browser_frame, |
548 BrowserView* browser_view) { | 548 BrowserView* browser_view) { |
549 return new BrowserFrameWin(browser_frame, browser_view); | 549 return new BrowserFrameWin(browser_frame, browser_view); |
550 } | 550 } |
OLD | NEW |