| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/proxy_overridden_bubble_controller.h" | 5 #include "chrome/browser/extensions/proxy_overridden_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_toolbar_model.h" | 9 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 10 #include "chrome/browser/extensions/settings_api_helpers.h" | 10 #include "chrome/browser/extensions/settings_api_helpers.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Whether the user has been notified about extension overriding the proxy. | 27 // Whether the user has been notified about extension overriding the proxy. |
| 28 const char kProxyBubbleAcknowledged[] = "ack_proxy_bubble"; | 28 const char kProxyBubbleAcknowledged[] = "ack_proxy_bubble"; |
| 29 | 29 |
| 30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
| 31 // ProxyOverriddenBubbleDelegate | 31 // ProxyOverriddenBubbleDelegate |
| 32 | 32 |
| 33 class ProxyOverriddenBubbleDelegate | 33 class ProxyOverriddenBubbleDelegate |
| 34 : public ExtensionMessageBubbleController::Delegate { | 34 : public ExtensionMessageBubbleController::Delegate { |
| 35 public: | 35 public: |
| 36 ProxyOverriddenBubbleDelegate(ExtensionService* service, Profile* profile); | 36 ProxyOverriddenBubbleDelegate(ExtensionService* service, Profile* profile); |
| 37 virtual ~ProxyOverriddenBubbleDelegate(); | 37 ~ProxyOverriddenBubbleDelegate() override; |
| 38 | 38 |
| 39 // ExtensionMessageBubbleController::Delegate methods. | 39 // ExtensionMessageBubbleController::Delegate methods. |
| 40 virtual bool ShouldIncludeExtension(const std::string& extension_id) override; | 40 bool ShouldIncludeExtension(const std::string& extension_id) override; |
| 41 virtual void AcknowledgeExtension( | 41 void AcknowledgeExtension( |
| 42 const std::string& extension_id, | 42 const std::string& extension_id, |
| 43 ExtensionMessageBubbleController::BubbleAction | 43 ExtensionMessageBubbleController::BubbleAction user_action) override; |
| 44 user_action) override; | 44 void PerformAction(const ExtensionIdList& list) override; |
| 45 virtual void PerformAction(const ExtensionIdList& list) override; | 45 void OnClose() override; |
| 46 virtual void OnClose() override; | 46 base::string16 GetTitle() const override; |
| 47 virtual base::string16 GetTitle() const override; | 47 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; |
| 48 virtual base::string16 GetMessageBody( | 48 base::string16 GetOverflowText( |
| 49 bool anchored_to_browser_action) const override; | |
| 50 virtual base::string16 GetOverflowText( | |
| 51 const base::string16& overflow_count) const override; | 49 const base::string16& overflow_count) const override; |
| 52 virtual GURL GetLearnMoreUrl() const override; | 50 GURL GetLearnMoreUrl() const override; |
| 53 virtual base::string16 GetActionButtonLabel() const override; | 51 base::string16 GetActionButtonLabel() const override; |
| 54 virtual base::string16 GetDismissButtonLabel() const override; | 52 base::string16 GetDismissButtonLabel() const override; |
| 55 virtual bool ShouldShowExtensionList() const override; | 53 bool ShouldShowExtensionList() const override; |
| 56 virtual void RestrictToSingleExtension( | 54 void RestrictToSingleExtension(const std::string& extension_id) override; |
| 57 const std::string& extension_id) override; | 55 void LogExtensionCount(size_t count) override; |
| 58 virtual void LogExtensionCount(size_t count) override; | 56 void LogAction( |
| 59 virtual void LogAction( | 57 ExtensionMessageBubbleController::BubbleAction action) override; |
| 60 ExtensionMessageBubbleController::BubbleAction | |
| 61 action) override; | |
| 62 | 58 |
| 63 private: | 59 private: |
| 64 // Our extension service. Weak, not owned by us. | 60 // Our extension service. Weak, not owned by us. |
| 65 ExtensionService* service_; | 61 ExtensionService* service_; |
| 66 | 62 |
| 67 // The ID of the extension we are showing the bubble for. | 63 // The ID of the extension we are showing the bubble for. |
| 68 std::string extension_id_; | 64 std::string extension_id_; |
| 69 | 65 |
| 70 DISALLOW_COPY_AND_ASSIGN(ProxyOverriddenBubbleDelegate); | 66 DISALLOW_COPY_AND_ASSIGN(ProxyOverriddenBubbleDelegate); |
| 71 }; | 67 }; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 200 |
| 205 delegate()->RestrictToSingleExtension(extension_id); | 201 delegate()->RestrictToSingleExtension(extension_id); |
| 206 return true; | 202 return true; |
| 207 } | 203 } |
| 208 | 204 |
| 209 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { | 205 bool ProxyOverriddenBubbleController::CloseOnDeactivate() { |
| 210 return false; | 206 return false; |
| 211 } | 207 } |
| 212 | 208 |
| 213 } // namespace extensions | 209 } // namespace extensions |
| OLD | NEW |