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_actions_api.h
" | 5 #include "chrome/browser/extensions/api/extension_action/extension_actions_api.h
" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 359 |
360 return RunExtensionAction(); | 360 return RunExtensionAction(); |
361 } | 361 } |
362 | 362 |
363 void ExtensionActionFunction::NotifyChange() { | 363 void ExtensionActionFunction::NotifyChange() { |
364 switch (extension_action_->action_type()) { | 364 switch (extension_action_->action_type()) { |
365 case extensions::Extension::ActionInfo::TYPE_BROWSER: | 365 case extensions::Extension::ActionInfo::TYPE_BROWSER: |
366 case extensions::Extension::ActionInfo::TYPE_PAGE: | 366 case extensions::Extension::ActionInfo::TYPE_PAGE: |
367 if (extensions::ExtensionActionManager::Get(profile_)-> | 367 if (extensions::ExtensionActionManager::Get(profile_)-> |
368 GetBrowserAction(*extension_)) { | 368 GetBrowserAction(*extension_)) { |
369 NotifyBrowserActionChange(); | 369 NotifyBrowserActionCextension_.get() |
370 } else if (extensions::ExtensionActionManager::Get(profile_)-> | 370 } else if (extensions::ExtensionActionManager::Get(profile_)-> |
371 GetPageAction(*extension_)) { | 371 GetPageAction(*extension_)) { |
372 NotifyLocationBarChange(); | 372 NotifyLocationBarChange(extension_.get() |
373 } | 373 } |
374 return; | 374 return; |
375 case extensions::Extension::ActionInfo::TYPE_SCRIPT_BADGE: | 375 case extensions::Extension::ActionInfo::TYPE_SCRIPT_BADGE: |
376 NotifyLocationBarChange(); | 376 NotifyLocationBarChange(); |
377 return; | 377 return; |
378 } | 378 } |
379 NOTREACHED(); | 379 NOTREACHED(); |
380 } | 380 } |
381 | 381 |
382 void ExtensionActionFunction::NotifyBrowserActionChange() { | 382 void ExtensionActionFunction::NotifyBrowserActionChange() { |
383 content::NotificationService::current()->Notify( | 383 content::NotificationService::current()->Notify( |
384 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | 384 chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 bool ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() { | 555 bool ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() { |
556 ListValue* list = new ListValue(); | 556 ListValue* list = new ListValue(); |
557 SkColor color = extension_action_->GetBadgeBackgroundColor(tab_id_); | 557 SkColor color = extension_action_->GetBadgeBackgroundColor(tab_id_); |
558 list->Append(Value::CreateIntegerValue(SkColorGetR(color))); | 558 list->Append(Value::CreateIntegerValue(SkColorGetR(color))); |
559 list->Append(Value::CreateIntegerValue(SkColorGetG(color))); | 559 list->Append(Value::CreateIntegerValue(SkColorGetG(color))); |
560 list->Append(Value::CreateIntegerValue(SkColorGetB(color))); | 560 list->Append(Value::CreateIntegerValue(SkColorGetB(color))); |
561 list->Append(Value::CreateIntegerValue(SkColorGetA(color))); | 561 list->Append(Value::CreateIntegerValue(SkColorGetA(color))); |
562 SetResult(list); | 562 SetResult(list); |
563 return true; | 563 return true; |
564 } | 564 } |
OLD | NEW |