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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 void ToolbarView::ExecuteExtensionCommand( | 339 void ToolbarView::ExecuteExtensionCommand( |
340 const extensions::Extension* extension, | 340 const extensions::Extension* extension, |
341 const extensions::Command& command) { | 341 const extensions::Command& command) { |
342 browser_actions_->ExecuteExtensionCommand(extension, command); | 342 browser_actions_->ExecuteExtensionCommand(extension, command); |
343 } | 343 } |
344 | 344 |
345 void ToolbarView::ShowAppMenu(bool for_drop) { | 345 void ToolbarView::ShowAppMenu(bool for_drop) { |
346 if (wrench_menu_.get() && wrench_menu_->IsShowing()) | 346 if (wrench_menu_.get() && wrench_menu_->IsShowing()) |
347 return; | 347 return; |
348 | 348 |
| 349 #if defined(USE_AURA) |
349 if (keyboard::KeyboardController::GetInstance() && | 350 if (keyboard::KeyboardController::GetInstance() && |
350 keyboard::KeyboardController::GetInstance()->keyboard_visible()) { | 351 keyboard::KeyboardController::GetInstance()->keyboard_visible()) { |
351 keyboard::KeyboardController::GetInstance()->HideKeyboard( | 352 keyboard::KeyboardController::GetInstance()->HideKeyboard( |
352 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); | 353 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); |
353 } | 354 } |
| 355 #endif |
354 | 356 |
355 wrench_menu_.reset( | 357 wrench_menu_.reset( |
356 new WrenchMenu(browser_, for_drop ? WrenchMenu::FOR_DROP : 0)); | 358 new WrenchMenu(browser_, for_drop ? WrenchMenu::FOR_DROP : 0)); |
357 wrench_menu_model_.reset(new WrenchMenuModel(this, browser_)); | 359 wrench_menu_model_.reset(new WrenchMenuModel(this, browser_)); |
358 wrench_menu_->Init(wrench_menu_model_.get()); | 360 wrench_menu_->Init(wrench_menu_model_.get()); |
359 | 361 |
360 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); | 362 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); |
361 | 363 |
362 wrench_menu_->RunMenu(app_menu_); | 364 wrench_menu_->RunMenu(app_menu_); |
363 } | 365 } |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 | 793 |
792 void ToolbarView::OnShowHomeButtonChanged() { | 794 void ToolbarView::OnShowHomeButtonChanged() { |
793 Layout(); | 795 Layout(); |
794 SchedulePaint(); | 796 SchedulePaint(); |
795 } | 797 } |
796 | 798 |
797 int ToolbarView::content_shadow_height() const { | 799 int ToolbarView::content_shadow_height() const { |
798 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 800 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
799 kContentShadowHeightAsh : kContentShadowHeight; | 801 kContentShadowHeightAsh : kContentShadowHeight; |
800 } | 802 } |
OLD | NEW |