Chromium Code Reviews| 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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
|
msw
2014/02/11 19:32:59
nit: remove this include.
Matt Giuca
2014/02/12 01:09:18
Done.
| |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
| 15 #include "chrome/browser/profiles/profiles_state.h" | 15 #include "chrome/browser/profiles/profiles_state.h" |
| 16 #include "chrome/browser/themes/theme_properties.h" | 16 #include "chrome/browser/themes/theme_properties.h" |
| 17 #include "chrome/browser/ui/views/avatar_label.h" | 17 #include "chrome/browser/ui/views/avatar_label.h" |
| 18 #include "chrome/browser/ui/views/avatar_menu_button.h" | 18 #include "chrome/browser/ui/views/avatar_menu_button.h" |
| 19 #include "chrome/browser/ui/views/frame/browser_frame.h" | 19 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 20 #include "chrome/browser/ui/views/frame/browser_view.h" | 20 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 21 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" | 21 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" |
| 22 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_platform_speci fic.h" | 22 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_platform_speci fic.h" |
| 23 #include "chrome/browser/ui/views/new_avatar_button.h" | 23 #include "chrome/browser/ui/views/new_avatar_button.h" |
| 24 #include "chrome/browser/ui/views/tab_icon_view.h" | 24 #include "chrome/browser/ui/views/tab_icon_view.h" |
| 25 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 25 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 26 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 26 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
|
msw
2014/02/11 19:32:59
nit: remove this include.
Matt Giuca
2014/02/12 01:09:18
Done.
| |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "chrome/common/profile_management_switches.h" | 29 #include "chrome/common/profile_management_switches.h" |
| 30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "grit/chromium_strings.h" | 32 #include "grit/chromium_strings.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 "grit/ui_resources.h" | 35 #include "grit/ui_resources.h" |
| 36 #include "ui/base/accessibility/accessible_view_state.h" | 36 #include "ui/base/accessibility/accessible_view_state.h" |
| 37 #include "ui/base/hit_test.h" | 37 #include "ui/base/hit_test.h" |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 589 return layout_->NonClientBorderThickness(); | 589 return layout_->NonClientBorderThickness(); |
| 590 } | 590 } |
| 591 | 591 |
| 592 gfx::Rect OpaqueBrowserFrameView::IconBounds() const { | 592 gfx::Rect OpaqueBrowserFrameView::IconBounds() const { |
| 593 return layout_->IconBounds(); | 593 return layout_->IconBounds(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const { | 596 bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const { |
| 597 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 597 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 598 // Do not show the custom title bar if the system title bar option is enabled. | 598 // Do not show the custom title bar if the system title bar option is enabled. |
| 599 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseSystemTitleBar)) | 599 if (!frame()->UseCustomFrame()) |
| 600 return false; | 600 return false; |
| 601 #endif | 601 #endif |
| 602 | 602 |
| 603 // Do not show caption buttons if the window manager is forcefully providing a | 603 // Do not show caption buttons if the window manager is forcefully providing a |
| 604 // title bar (e.g., in Ubuntu Unity, if the window is maximized). | 604 // title bar (e.g., in Ubuntu Unity, if the window is maximized). |
| 605 if (!views::ViewsDelegate::views_delegate) | 605 if (!views::ViewsDelegate::views_delegate) |
| 606 return true; | 606 return true; |
| 607 return !views::ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar( | 607 return !views::ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar( |
| 608 IsMaximized()); | 608 IsMaximized()); |
| 609 } | 609 } |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 | 914 |
| 915 int OpaqueBrowserFrameView::GetTopAreaHeight() const { | 915 int OpaqueBrowserFrameView::GetTopAreaHeight() const { |
| 916 gfx::ImageSkia* frame_image = GetFrameImage(); | 916 gfx::ImageSkia* frame_image = GetFrameImage(); |
| 917 int top_area_height = frame_image->height(); | 917 int top_area_height = frame_image->height(); |
| 918 if (browser_view()->IsTabStripVisible()) { | 918 if (browser_view()->IsTabStripVisible()) { |
| 919 top_area_height = std::max(top_area_height, | 919 top_area_height = std::max(top_area_height, |
| 920 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); | 920 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); |
| 921 } | 921 } |
| 922 return top_area_height; | 922 return top_area_height; |
| 923 } | 923 } |
| OLD | NEW |