| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/extension_action/extension_action_api.h" | 5 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 list->Append( | 787 list->Append( |
| 788 new base::FundamentalValue(static_cast<int>(SkColorGetA(color)))); | 788 new base::FundamentalValue(static_cast<int>(SkColorGetA(color)))); |
| 789 SetResult(list); | 789 SetResult(list); |
| 790 return true; | 790 return true; |
| 791 } | 791 } |
| 792 | 792 |
| 793 BrowserActionOpenPopupFunction::BrowserActionOpenPopupFunction() | 793 BrowserActionOpenPopupFunction::BrowserActionOpenPopupFunction() |
| 794 : response_sent_(false) { | 794 : response_sent_(false) { |
| 795 } | 795 } |
| 796 | 796 |
| 797 bool BrowserActionOpenPopupFunction::RunImpl() { | 797 bool BrowserActionOpenPopupFunction::RunAsync() { |
| 798 ExtensionToolbarModel* model = ExtensionToolbarModel::Get(GetProfile()); | 798 ExtensionToolbarModel* model = ExtensionToolbarModel::Get(GetProfile()); |
| 799 if (!model) { | 799 if (!model) { |
| 800 error_ = kInternalError; | 800 error_ = kInternalError; |
| 801 return false; | 801 return false; |
| 802 } | 802 } |
| 803 | 803 |
| 804 if (!model->ShowBrowserActionPopup(extension_)) { | 804 if (!model->ShowBrowserActionPopup(extension_)) { |
| 805 error_ = kOpenPopupError; | 805 error_ = kOpenPopupError; |
| 806 return false; | 806 return false; |
| 807 } | 807 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 return true; | 915 return true; |
| 916 } | 916 } |
| 917 | 917 |
| 918 bool EnablePageActionsFunction::RunSync() { | 918 bool EnablePageActionsFunction::RunSync() { |
| 919 return SetPageActionEnabled(true); | 919 return SetPageActionEnabled(true); |
| 920 } | 920 } |
| 921 | 921 |
| 922 bool DisablePageActionsFunction::RunSync() { | 922 bool DisablePageActionsFunction::RunSync() { |
| 923 return SetPageActionEnabled(false); | 923 return SetPageActionEnabled(false); |
| 924 } | 924 } |
| OLD | NEW |