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