| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // browser notification requirements, and not all functions are defined for all | 118 // browser notification requirements, and not all functions are defined for all |
| 119 // APIs). | 119 // APIs). |
| 120 class ExtensionActionFunction : public ChromeSyncExtensionFunction { | 120 class ExtensionActionFunction : public ChromeSyncExtensionFunction { |
| 121 public: | 121 public: |
| 122 static bool ParseCSSColorString(const std::string& color_string, | 122 static bool ParseCSSColorString(const std::string& color_string, |
| 123 SkColor* result); | 123 SkColor* result); |
| 124 | 124 |
| 125 protected: | 125 protected: |
| 126 ExtensionActionFunction(); | 126 ExtensionActionFunction(); |
| 127 virtual ~ExtensionActionFunction(); | 127 virtual ~ExtensionActionFunction(); |
| 128 virtual bool RunImpl() OVERRIDE; | 128 virtual bool RunSync() OVERRIDE; |
| 129 virtual bool RunExtensionAction() = 0; | 129 virtual bool RunExtensionAction() = 0; |
| 130 | 130 |
| 131 bool ExtractDataFromArguments(); | 131 bool ExtractDataFromArguments(); |
| 132 void NotifyChange(); | 132 void NotifyChange(); |
| 133 void NotifyBrowserActionChange(); | 133 void NotifyBrowserActionChange(); |
| 134 void NotifyLocationBarChange(); | 134 void NotifyLocationBarChange(); |
| 135 void NotifySystemIndicatorChange(); | 135 void NotifySystemIndicatorChange(); |
| 136 bool SetVisible(bool visible); | 136 bool SetVisible(bool visible); |
| 137 | 137 |
| 138 // Extension-related information for |tab_id_|. | 138 // Extension-related information for |tab_id_|. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 public content::NotificationObserver { | 344 public content::NotificationObserver { |
| 345 public: | 345 public: |
| 346 DECLARE_EXTENSION_FUNCTION("browserAction.openPopup", | 346 DECLARE_EXTENSION_FUNCTION("browserAction.openPopup", |
| 347 BROWSERACTION_OPEN_POPUP) | 347 BROWSERACTION_OPEN_POPUP) |
| 348 BrowserActionOpenPopupFunction(); | 348 BrowserActionOpenPopupFunction(); |
| 349 | 349 |
| 350 private: | 350 private: |
| 351 virtual ~BrowserActionOpenPopupFunction() {} | 351 virtual ~BrowserActionOpenPopupFunction() {} |
| 352 | 352 |
| 353 // ExtensionFunction: | 353 // ExtensionFunction: |
| 354 virtual bool RunImpl() OVERRIDE; | 354 virtual bool RunSync() OVERRIDE; |
| 355 | 355 |
| 356 virtual void Observe(int type, | 356 virtual void Observe(int type, |
| 357 const content::NotificationSource& source, | 357 const content::NotificationSource& source, |
| 358 const content::NotificationDetails& details) OVERRIDE; | 358 const content::NotificationDetails& details) OVERRIDE; |
| 359 void OpenPopupTimedOut(); | 359 void OpenPopupTimedOut(); |
| 360 | 360 |
| 361 content::NotificationRegistrar registrar_; | 361 content::NotificationRegistrar registrar_; |
| 362 bool response_sent_; | 362 bool response_sent_; |
| 363 | 363 |
| 364 DISALLOW_COPY_AND_ASSIGN(BrowserActionOpenPopupFunction); | 364 DISALLOW_COPY_AND_ASSIGN(BrowserActionOpenPopupFunction); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 // Implement chrome.pageActions.enableForTab(). | 442 // Implement chrome.pageActions.enableForTab(). |
| 443 class EnablePageActionsFunction : public PageActionsFunction { | 443 class EnablePageActionsFunction : public PageActionsFunction { |
| 444 public: | 444 public: |
| 445 DECLARE_EXTENSION_FUNCTION("pageActions.enableForTab", | 445 DECLARE_EXTENSION_FUNCTION("pageActions.enableForTab", |
| 446 PAGEACTIONS_ENABLEFORTAB) | 446 PAGEACTIONS_ENABLEFORTAB) |
| 447 | 447 |
| 448 protected: | 448 protected: |
| 449 virtual ~EnablePageActionsFunction() {} | 449 virtual ~EnablePageActionsFunction() {} |
| 450 | 450 |
| 451 // ExtensionFunction: | 451 // ExtensionFunction: |
| 452 virtual bool RunImpl() OVERRIDE; | 452 virtual bool RunSync() OVERRIDE; |
| 453 }; | 453 }; |
| 454 | 454 |
| 455 // Implement chrome.pageActions.disableForTab(). | 455 // Implement chrome.pageActions.disableForTab(). |
| 456 class DisablePageActionsFunction : public PageActionsFunction { | 456 class DisablePageActionsFunction : public PageActionsFunction { |
| 457 public: | 457 public: |
| 458 DECLARE_EXTENSION_FUNCTION("pageActions.disableForTab", | 458 DECLARE_EXTENSION_FUNCTION("pageActions.disableForTab", |
| 459 PAGEACTIONS_DISABLEFORTAB) | 459 PAGEACTIONS_DISABLEFORTAB) |
| 460 | 460 |
| 461 protected: | 461 protected: |
| 462 virtual ~DisablePageActionsFunction() {} | 462 virtual ~DisablePageActionsFunction() {} |
| 463 | 463 |
| 464 // ExtensionFunction: | 464 // ExtensionFunction: |
| 465 virtual bool RunImpl() OVERRIDE; | 465 virtual bool RunSync() OVERRIDE; |
| 466 }; | 466 }; |
| 467 | 467 |
| 468 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H
_ | 468 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H
_ |
| OLD | NEW |