Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: chrome/browser/extensions/api/extension_action/extension_action_api.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698