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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 list->Append( | 793 list->Append( |
794 new base::FundamentalValue(static_cast<int>(SkColorGetA(color)))); | 794 new base::FundamentalValue(static_cast<int>(SkColorGetA(color)))); |
795 SetResult(list); | 795 SetResult(list); |
796 return true; | 796 return true; |
797 } | 797 } |
798 | 798 |
799 BrowserActionOpenPopupFunction::BrowserActionOpenPopupFunction() | 799 BrowserActionOpenPopupFunction::BrowserActionOpenPopupFunction() |
800 : response_sent_(false) { | 800 : response_sent_(false) { |
801 } | 801 } |
802 | 802 |
803 bool BrowserActionOpenPopupFunction::RunImpl() { | 803 bool BrowserActionOpenPopupFunction::RunAsync() { |
804 ExtensionToolbarModel* model = ExtensionToolbarModel::Get(GetProfile()); | 804 ExtensionToolbarModel* model = ExtensionToolbarModel::Get(GetProfile()); |
805 if (!model) { | 805 if (!model) { |
806 error_ = kInternalError; | 806 error_ = kInternalError; |
807 return false; | 807 return false; |
808 } | 808 } |
809 | 809 |
810 if (!model->ShowBrowserActionPopup(extension_)) { | 810 if (!model->ShowBrowserActionPopup(extension_)) { |
811 error_ = kOpenPopupError; | 811 error_ = kOpenPopupError; |
812 return false; | 812 return false; |
813 } | 813 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 return true; | 921 return true; |
922 } | 922 } |
923 | 923 |
924 bool EnablePageActionsFunction::RunSync() { | 924 bool EnablePageActionsFunction::RunSync() { |
925 return SetPageActionEnabled(true); | 925 return SetPageActionEnabled(true); |
926 } | 926 } |
927 | 927 |
928 bool DisablePageActionsFunction::RunSync() { | 928 bool DisablePageActionsFunction::RunSync() { |
929 return SetPageActionEnabled(false); | 929 return SetPageActionEnabled(false); |
930 } | 930 } |
OLD | NEW |