| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/toolbar/toolbar_actions_bar.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate( | 597 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate( |
| 598 new ExtensionMessageBubbleBridge(std::move(controller))); | 598 new ExtensionMessageBubbleBridge(std::move(controller))); |
| 599 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 599 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 600 FROM_HERE, base::Bind(&ToolbarActionsBar::ShowToolbarActionBubble, | 600 FROM_HERE, base::Bind(&ToolbarActionsBar::ShowToolbarActionBubble, |
| 601 weak_ptr_factory_.GetWeakPtr(), | 601 weak_ptr_factory_.GetWeakPtr(), |
| 602 base::Passed(std::move(delegate))), | 602 base::Passed(std::move(delegate))), |
| 603 base::TimeDelta::FromSeconds( | 603 base::TimeDelta::FromSeconds( |
| 604 g_extension_bubble_appearance_wait_time_in_seconds)); | 604 g_extension_bubble_appearance_wait_time_in_seconds)); |
| 605 } | 605 } |
| 606 | 606 |
| 607 ToolbarActionViewController* ToolbarActionsBar::popped_out_action() { |
| 608 return popped_out_action_; |
| 609 } |
| 610 |
| 607 // static | 611 // static |
| 608 void ToolbarActionsBar::set_extension_bubble_appearance_wait_time_for_testing( | 612 void ToolbarActionsBar::set_extension_bubble_appearance_wait_time_for_testing( |
| 609 int time_in_seconds) { | 613 int time_in_seconds) { |
| 610 g_extension_bubble_appearance_wait_time_in_seconds = time_in_seconds; | 614 g_extension_bubble_appearance_wait_time_in_seconds = time_in_seconds; |
| 611 } | 615 } |
| 612 | 616 |
| 613 void ToolbarActionsBar::OnToolbarActionAdded( | 617 void ToolbarActionsBar::OnToolbarActionAdded( |
| 614 const ToolbarActionsModel::ToolbarItem& item, | 618 const ToolbarActionsModel::ToolbarItem& item, |
| 615 int index) { | 619 int index) { |
| 616 CHECK(model_->actions_initialized()); | 620 CHECK(model_->actions_initialized()); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 for (ToolbarActionViewController* action : toolbar_actions_) { | 806 for (ToolbarActionViewController* action : toolbar_actions_) { |
| 803 if (action->GetId() == action_id) | 807 if (action->GetId() == action_id) |
| 804 return action; | 808 return action; |
| 805 } | 809 } |
| 806 return nullptr; | 810 return nullptr; |
| 807 } | 811 } |
| 808 | 812 |
| 809 content::WebContents* ToolbarActionsBar::GetCurrentWebContents() { | 813 content::WebContents* ToolbarActionsBar::GetCurrentWebContents() { |
| 810 return browser_->tab_strip_model()->GetActiveWebContents(); | 814 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 811 } | 815 } |
| OLD | NEW |