| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 // ToolbarView, views::MenuButtonListener implementation: | 405 // ToolbarView, views::MenuButtonListener implementation: |
| 406 | 406 |
| 407 void ToolbarView::OnMenuButtonClicked(views::View* source, | 407 void ToolbarView::OnMenuButtonClicked(views::View* source, |
| 408 const gfx::Point& point) { | 408 const gfx::Point& point) { |
| 409 TRACE_EVENT0("views", "ToolbarView::OnMenuButtonClicked"); | 409 TRACE_EVENT0("views", "ToolbarView::OnMenuButtonClicked"); |
| 410 DCHECK_EQ(VIEW_ID_APP_MENU, source->id()); | 410 DCHECK_EQ(VIEW_ID_APP_MENU, source->id()); |
| 411 | 411 |
| 412 bool use_new_menu = false; | 412 bool use_new_menu = false; |
| 413 bool supports_new_separators = false; | 413 bool supports_new_separators = false; |
| 414 // TODO: remove this. | 414 // TODO: remove this. |
| 415 #if defined(USE_AURA) | 415 #if defined(USE_AURA) && !(defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 416 supports_new_separators = | 416 supports_new_separators = |
| 417 GetNativeTheme() == ui::NativeThemeAura::instance(); | 417 GetNativeTheme() == ui::NativeThemeAura::instance(); |
| 418 use_new_menu = supports_new_separators; | 418 use_new_menu = supports_new_separators; |
| 419 #endif | 419 #endif |
| 420 #if defined(OS_WIN) | 420 #if defined(OS_WIN) |
| 421 use_new_menu = use_new_menu || ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; | 421 use_new_menu = use_new_menu || ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; |
| 422 #endif | 422 #endif |
| 423 | 423 |
| 424 wrench_menu_.reset(new WrenchMenu(browser_, use_new_menu, | 424 wrench_menu_.reset(new WrenchMenu(browser_, use_new_menu, |
| 425 supports_new_separators)); | 425 supports_new_separators)); |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 | 885 |
| 886 void ToolbarView::OnShowHomeButtonChanged() { | 886 void ToolbarView::OnShowHomeButtonChanged() { |
| 887 Layout(); | 887 Layout(); |
| 888 SchedulePaint(); | 888 SchedulePaint(); |
| 889 } | 889 } |
| 890 | 890 |
| 891 int ToolbarView::content_shadow_height() const { | 891 int ToolbarView::content_shadow_height() const { |
| 892 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 892 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
| 893 kContentShadowHeightAsh : kContentShadowHeight; | 893 kContentShadowHeightAsh : kContentShadowHeight; |
| 894 } | 894 } |
| OLD | NEW |