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/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 wrench_menu_.reset( | 342 wrench_menu_.reset( |
343 new WrenchMenu(browser_, for_drop ? WrenchMenu::FOR_DROP : 0)); | 343 new WrenchMenu(browser_, for_drop ? WrenchMenu::FOR_DROP : 0)); |
344 wrench_menu_model_.reset(new WrenchMenuModel(this, browser_)); | 344 wrench_menu_model_.reset(new WrenchMenuModel(this, browser_)); |
345 wrench_menu_->Init(wrench_menu_model_.get()); | 345 wrench_menu_->Init(wrench_menu_model_.get()); |
346 | 346 |
347 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); | 347 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); |
348 | 348 |
349 wrench_menu_->RunMenu(app_menu_); | 349 wrench_menu_->RunMenu(app_menu_); |
350 } | 350 } |
351 | 351 |
| 352 void ToolbarView::CloseAppMenu() { |
| 353 if (wrench_menu_) |
| 354 wrench_menu_->CloseMenu(); |
| 355 } |
| 356 |
352 //////////////////////////////////////////////////////////////////////////////// | 357 //////////////////////////////////////////////////////////////////////////////// |
353 // ToolbarView, AccessiblePaneView overrides: | 358 // ToolbarView, AccessiblePaneView overrides: |
354 | 359 |
355 bool ToolbarView::SetPaneFocus(views::View* initial_focus) { | 360 bool ToolbarView::SetPaneFocus(views::View* initial_focus) { |
356 if (!AccessiblePaneView::SetPaneFocus(initial_focus)) | 361 if (!AccessiblePaneView::SetPaneFocus(initial_focus)) |
357 return false; | 362 return false; |
358 | 363 |
359 location_bar_->SetShowFocusRect(true); | 364 location_bar_->SetShowFocusRect(true); |
360 return true; | 365 return true; |
361 } | 366 } |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 | 785 |
781 void ToolbarView::OnShowHomeButtonChanged() { | 786 void ToolbarView::OnShowHomeButtonChanged() { |
782 Layout(); | 787 Layout(); |
783 SchedulePaint(); | 788 SchedulePaint(); |
784 } | 789 } |
785 | 790 |
786 int ToolbarView::content_shadow_height() const { | 791 int ToolbarView::content_shadow_height() const { |
787 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 792 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
788 kContentShadowHeightAsh : kContentShadowHeight; | 793 kContentShadowHeightAsh : kContentShadowHeight; |
789 } | 794 } |
OLD | NEW |