| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/test_toolbar_action_view_controller.h" | 5 #include "chrome/browser/ui/toolbar/test_toolbar_action_view_controller.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "chrome/browser/ui/toolbar/toolbar_action_view_delegate.h" | 8 #include "chrome/browser/ui/toolbar/toolbar_action_view_delegate.h" |
| 9 #include "ui/gfx/image/image.h" | 9 #include "ui/gfx/image/image.h" |
| 10 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
| 11 | 11 |
| 12 TestToolbarActionViewController::TestToolbarActionViewController( | 12 TestToolbarActionViewController::TestToolbarActionViewController( |
| 13 const std::string& id) | 13 const std::string& id) |
| 14 : id_(id), | 14 : id_(id), |
| 15 delegate_(nullptr), | 15 delegate_(nullptr), |
| 16 is_enabled_(true), | 16 is_enabled_(true), |
| 17 wants_to_run_(false), | 17 wants_to_run_(false), |
| 18 disabled_click_opens_menu_(false), | 18 disabled_click_opens_menu_(false), |
| 19 execute_action_count_(0) { | 19 execute_action_count_(0) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 TestToolbarActionViewController::~TestToolbarActionViewController() { | 22 TestToolbarActionViewController::~TestToolbarActionViewController() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 const std::string& TestToolbarActionViewController::GetId() const { | 25 std::string TestToolbarActionViewController::GetId() const { |
| 26 return id_; | 26 return id_; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void TestToolbarActionViewController::SetDelegate( | 29 void TestToolbarActionViewController::SetDelegate( |
| 30 ToolbarActionViewDelegate* delegate) { | 30 ToolbarActionViewDelegate* delegate) { |
| 31 delegate_ = delegate; | 31 delegate_ = delegate; |
| 32 } | 32 } |
| 33 | 33 |
| 34 gfx::Image TestToolbarActionViewController::GetIcon( | 34 gfx::Image TestToolbarActionViewController::GetIcon( |
| 35 content::WebContents* web_contents, | 35 content::WebContents* web_contents, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void TestToolbarActionViewController::SetDisabledClickOpensMenu( | 124 void TestToolbarActionViewController::SetDisabledClickOpensMenu( |
| 125 bool disabled_click_opens_menu) { | 125 bool disabled_click_opens_menu) { |
| 126 disabled_click_opens_menu_ = disabled_click_opens_menu; | 126 disabled_click_opens_menu_ = disabled_click_opens_menu; |
| 127 UpdateDelegate(); | 127 UpdateDelegate(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void TestToolbarActionViewController::UpdateDelegate() { | 130 void TestToolbarActionViewController::UpdateDelegate() { |
| 131 if (delegate_) | 131 if (delegate_) |
| 132 delegate_->UpdateState(); | 132 delegate_->UpdateState(); |
| 133 } | 133 } |
| OLD | NEW |