| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dev_mode_bubble_controller.h" | 5 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
| 10 #include "chrome/browser/extensions/extension_message_bubble.h" | 10 #include "chrome/browser/extensions/extension_message_bubble.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
| 32 // DevModeBubbleDelegate | 32 // DevModeBubbleDelegate |
| 33 | 33 |
| 34 class DevModeBubbleDelegate | 34 class DevModeBubbleDelegate |
| 35 : public ExtensionMessageBubbleController::Delegate { | 35 : public ExtensionMessageBubbleController::Delegate { |
| 36 public: | 36 public: |
| 37 explicit DevModeBubbleDelegate(Profile* profile); | 37 explicit DevModeBubbleDelegate(Profile* profile); |
| 38 virtual ~DevModeBubbleDelegate(); | 38 virtual ~DevModeBubbleDelegate(); |
| 39 | 39 |
| 40 // ExtensionMessageBubbleController::Delegate methods. | 40 // ExtensionMessageBubbleController::Delegate methods. |
| 41 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; | 41 virtual bool ShouldIncludeExtension(const std::string& extension_id) override; |
| 42 virtual void AcknowledgeExtension( | 42 virtual void AcknowledgeExtension( |
| 43 const std::string& extension_id, | 43 const std::string& extension_id, |
| 44 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE; | 44 ExtensionMessageBubbleController::BubbleAction user_action) override; |
| 45 virtual void PerformAction(const ExtensionIdList& list) OVERRIDE; | 45 virtual void PerformAction(const ExtensionIdList& list) override; |
| 46 virtual void OnClose() OVERRIDE; | 46 virtual void OnClose() override; |
| 47 virtual base::string16 GetTitle() const OVERRIDE; | 47 virtual base::string16 GetTitle() const override; |
| 48 virtual base::string16 GetMessageBody( | 48 virtual base::string16 GetMessageBody( |
| 49 bool anchored_to_browser_action) const OVERRIDE; | 49 bool anchored_to_browser_action) const override; |
| 50 virtual base::string16 GetOverflowText( | 50 virtual base::string16 GetOverflowText( |
| 51 const base::string16& overflow_count) const OVERRIDE; | 51 const base::string16& overflow_count) const override; |
| 52 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; | 52 virtual base::string16 GetLearnMoreLabel() const override; |
| 53 virtual GURL GetLearnMoreUrl() const OVERRIDE; | 53 virtual GURL GetLearnMoreUrl() const override; |
| 54 virtual base::string16 GetActionButtonLabel() const OVERRIDE; | 54 virtual base::string16 GetActionButtonLabel() const override; |
| 55 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; | 55 virtual base::string16 GetDismissButtonLabel() const override; |
| 56 virtual bool ShouldShowExtensionList() const OVERRIDE; | 56 virtual bool ShouldShowExtensionList() const override; |
| 57 virtual void LogExtensionCount(size_t count) OVERRIDE; | 57 virtual void LogExtensionCount(size_t count) override; |
| 58 virtual void LogAction( | 58 virtual void LogAction( |
| 59 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; | 59 ExtensionMessageBubbleController::BubbleAction action) override; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 // The associated profile (weak). | 62 // The associated profile (weak). |
| 63 Profile* profile_; | 63 Profile* profile_; |
| 64 | 64 |
| 65 // Our extension service. Weak, not owned by us. | 65 // Our extension service. Weak, not owned by us. |
| 66 ExtensionService* service_; | 66 ExtensionService* service_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(DevModeBubbleDelegate); |
| 69 }; | 69 }; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && | 180 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && |
| 181 !GetExtensionList().empty(); | 181 !GetExtensionList().empty(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { | 184 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { |
| 185 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); | 185 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); |
| 186 ExtensionMessageBubbleController::Show(bubble); | 186 ExtensionMessageBubbleController::Show(bubble); |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace extensions | 189 } // namespace extensions |
| OLD | NEW |