| 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 20 matching lines...) Expand all Loading... |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/common/page_transition_types.h" | 32 #include "content/public/common/page_transition_types.h" |
| 33 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
| 34 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
| 35 #include "grit/theme_resources.h" | 35 #include "grit/theme_resources.h" |
| 36 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 37 #include "ui/base/layout.h" | 37 #include "ui/base/layout.h" |
| 38 #include "ui/base/models/simple_menu_model.h" | 38 #include "ui/base/models/simple_menu_model.h" |
| 39 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
| 40 #include "ui/base/theme_provider.h" | 40 #include "ui/base/theme_provider.h" |
| 41 #include "ui/base/win/dpi.h" |
| 41 #include "ui/base/window_open_disposition.h" | 42 #include "ui/base/window_open_disposition.h" |
| 42 #include "ui/gfx/font.h" | 43 #include "ui/gfx/font.h" |
| 43 #include "ui/views/controls/menu/native_menu_win.h" | 44 #include "ui/views/controls/menu/native_menu_win.h" |
| 44 #include "ui/views/views_delegate.h" | 45 #include "ui/views/views_delegate.h" |
| 45 #include "ui/views/widget/native_widget_win.h" | 46 #include "ui/views/widget/native_widget_win.h" |
| 46 #include "ui/views/widget/widget.h" | 47 #include "ui/views/widget/widget.h" |
| 47 #include "ui/views/window/non_client_view.h" | 48 #include "ui/views/window/non_client_view.h" |
| 48 #include "win8/util/win8_util.h" | 49 #include "win8/util/win8_util.h" |
| 49 | 50 |
| 50 #pragma comment(lib, "dwmapi.lib") | 51 #pragma comment(lib, "dwmapi.lib") |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 margins.cxLeftWidth = kClientEdgeThickness + 1; | 435 margins.cxLeftWidth = kClientEdgeThickness + 1; |
| 435 margins.cxRightWidth = kClientEdgeThickness + 1; | 436 margins.cxRightWidth = kClientEdgeThickness + 1; |
| 436 margins.cyBottomHeight = kClientEdgeThickness + 1; | 437 margins.cyBottomHeight = kClientEdgeThickness + 1; |
| 437 margins.cyTopHeight = kClientEdgeThickness + 1; | 438 margins.cyTopHeight = kClientEdgeThickness + 1; |
| 438 } | 439 } |
| 439 // In maximized mode, we only have a titlebar strip of glass, no side/bottom | 440 // In maximized mode, we only have a titlebar strip of glass, no side/bottom |
| 440 // borders. | 441 // borders. |
| 441 if (!IsFullscreen()) { | 442 if (!IsFullscreen()) { |
| 442 gfx::Rect tabstrip_bounds( | 443 gfx::Rect tabstrip_bounds( |
| 443 browser_frame_->GetBoundsForTabStrip(browser_view_->tabstrip())); | 444 browser_frame_->GetBoundsForTabStrip(browser_view_->tabstrip())); |
| 445 tabstrip_bounds = ui::win::DIPToScreenRect(tabstrip_bounds); |
| 444 margins.cyTopHeight = tabstrip_bounds.bottom() + kDWMFrameTopOffset; | 446 margins.cyTopHeight = tabstrip_bounds.bottom() + kDWMFrameTopOffset; |
| 445 } | 447 } |
| 446 } | 448 } |
| 447 | 449 |
| 448 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); | 450 DwmExtendFrameIntoClientArea(GetNativeView(), &margins); |
| 449 } | 451 } |
| 450 | 452 |
| 451 void BrowserFrameWin::HandleMetroNavSearchRequest(WPARAM w_param, | 453 void BrowserFrameWin::HandleMetroNavSearchRequest(WPARAM w_param, |
| 452 LPARAM l_param) { | 454 LPARAM l_param) { |
| 453 if (!base::win::IsMetroProcess()) { | 455 if (!base::win::IsMetroProcess()) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 538 |
| 537 //////////////////////////////////////////////////////////////////////////////// | 539 //////////////////////////////////////////////////////////////////////////////// |
| 538 // NativeBrowserFrame, public: | 540 // NativeBrowserFrame, public: |
| 539 | 541 |
| 540 // static | 542 // static |
| 541 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | 543 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( |
| 542 BrowserFrame* browser_frame, | 544 BrowserFrame* browser_frame, |
| 543 BrowserView* browser_view) { | 545 BrowserView* browser_view) { |
| 544 return new BrowserFrameWin(browser_frame, browser_view); | 546 return new BrowserFrameWin(browser_frame, browser_view); |
| 545 } | 547 } |
| OLD | NEW |