Chromium Code Reviews| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 ExtensionAction* extension_action = | 331 ExtensionAction* extension_action = |
| 332 extension_manager->GetPageAction(*extension); | 332 extension_manager->GetPageAction(*extension); |
| 333 if (extension_action) { | 333 if (extension_action) { |
| 334 location_bar_->GetPageActionView(extension_action)->image_view()-> | 334 location_bar_->GetPageActionView(extension_action)->image_view()-> |
| 335 ExecuteAction(ExtensionPopup::SHOW); | 335 ExecuteAction(ExtensionPopup::SHOW); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 void ToolbarView::ShowBrowserActionPopup( | 339 void ToolbarView::ShowBrowserActionPopup( |
| 340 const extensions::Extension* extension) { | 340 const extensions::Extension* extension) { |
| 341 browser_actions_->ShowPopup(extension, true); | 341 browser_actions_->ShowPopupForExtension( |
| 342 extension, | |
| 343 true, // Grant active tab permissions. | |
| 344 false); // Don't override the current view. | |
|
Peter Kasting
2014/07/26 02:33:20
Nit: I'm not a huge fan of comments on function ar
Devlin
2014/07/29 19:07:15
I typically view them as providing a reference to
Peter Kasting
2014/07/29 19:18:01
I think those are probably slightly worse than the
| |
| 342 } | 345 } |
| 343 | 346 |
| 344 void ToolbarView::ShowAppMenu(bool for_drop) { | 347 void ToolbarView::ShowAppMenu(bool for_drop) { |
| 345 if (wrench_menu_.get() && wrench_menu_->IsShowing()) | 348 if (wrench_menu_.get() && wrench_menu_->IsShowing()) |
| 346 return; | 349 return; |
| 347 | 350 |
| 348 int run_flags = 0; | 351 int run_flags = 0; |
| 349 bool use_new_menu = false; | 352 bool use_new_menu = false; |
| 350 // TODO: remove this. | 353 // TODO: remove this. |
| 351 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) | 354 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 800 | 803 |
| 801 void ToolbarView::OnShowHomeButtonChanged() { | 804 void ToolbarView::OnShowHomeButtonChanged() { |
| 802 Layout(); | 805 Layout(); |
| 803 SchedulePaint(); | 806 SchedulePaint(); |
| 804 } | 807 } |
| 805 | 808 |
| 806 int ToolbarView::content_shadow_height() const { | 809 int ToolbarView::content_shadow_height() const { |
| 807 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 810 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
| 808 kContentShadowHeightAsh : kContentShadowHeight; | 811 kContentShadowHeightAsh : kContentShadowHeight; |
| 809 } | 812 } |
| OLD | NEW |