| 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 // Implements the Chrome Extensions Debugger API. | 5 // Implements the Chrome Extensions Debugger API. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" | 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void set_client_host(ExtensionDevToolsClientHost* client_host) { | 163 void set_client_host(ExtensionDevToolsClientHost* client_host) { |
| 164 client_host_ = client_host; | 164 client_host_ = client_host; |
| 165 } | 165 } |
| 166 | 166 |
| 167 private: | 167 private: |
| 168 explicit ExtensionDevToolsInfoBarDelegate(const std::string& client_name); | 168 explicit ExtensionDevToolsInfoBarDelegate(const std::string& client_name); |
| 169 ~ExtensionDevToolsInfoBarDelegate() override; | 169 ~ExtensionDevToolsInfoBarDelegate() override; |
| 170 | 170 |
| 171 // ConfirmInfoBarDelegate: | 171 // ConfirmInfoBarDelegate: |
| 172 Type GetInfoBarType() const override; | 172 Type GetInfoBarType() const override; |
| 173 bool ShouldExpire(const NavigationDetails& details) const override; |
| 173 void InfoBarDismissed() override; | 174 void InfoBarDismissed() override; |
| 174 bool ShouldExpireInternal(const NavigationDetails& details) const override; | |
| 175 base::string16 GetMessageText() const override; | 175 base::string16 GetMessageText() const override; |
| 176 int GetButtons() const override; | 176 int GetButtons() const override; |
| 177 bool Cancel() override; | 177 bool Cancel() override; |
| 178 | 178 |
| 179 std::string client_name_; | 179 std::string client_name_; |
| 180 ExtensionDevToolsClientHost* client_host_; | 180 ExtensionDevToolsClientHost* client_host_; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(ExtensionDevToolsInfoBarDelegate); | 182 DISALLOW_COPY_AND_ASSIGN(ExtensionDevToolsInfoBarDelegate); |
| 183 }; | 183 }; |
| 184 | 184 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 207 } | 207 } |
| 208 | 208 |
| 209 ExtensionDevToolsInfoBarDelegate::~ExtensionDevToolsInfoBarDelegate() { | 209 ExtensionDevToolsInfoBarDelegate::~ExtensionDevToolsInfoBarDelegate() { |
| 210 } | 210 } |
| 211 | 211 |
| 212 infobars::InfoBarDelegate::Type | 212 infobars::InfoBarDelegate::Type |
| 213 ExtensionDevToolsInfoBarDelegate::GetInfoBarType() const { | 213 ExtensionDevToolsInfoBarDelegate::GetInfoBarType() const { |
| 214 return WARNING_TYPE; | 214 return WARNING_TYPE; |
| 215 } | 215 } |
| 216 | 216 |
| 217 bool ExtensionDevToolsInfoBarDelegate::ShouldExpire( |
| 218 const NavigationDetails& details) const { |
| 219 return false; |
| 220 } |
| 221 |
| 217 void ExtensionDevToolsInfoBarDelegate::InfoBarDismissed() { | 222 void ExtensionDevToolsInfoBarDelegate::InfoBarDismissed() { |
| 218 if (client_host_) | 223 if (client_host_) |
| 219 client_host_->MarkAsDismissed(); | 224 client_host_->MarkAsDismissed(); |
| 220 } | 225 } |
| 221 | 226 |
| 222 bool ExtensionDevToolsInfoBarDelegate::ShouldExpireInternal( | |
| 223 const NavigationDetails& details) const { | |
| 224 return false; | |
| 225 } | |
| 226 | |
| 227 base::string16 ExtensionDevToolsInfoBarDelegate::GetMessageText() const { | 227 base::string16 ExtensionDevToolsInfoBarDelegate::GetMessageText() const { |
| 228 return l10n_util::GetStringFUTF16(IDS_DEV_TOOLS_INFOBAR_LABEL, | 228 return l10n_util::GetStringFUTF16(IDS_DEV_TOOLS_INFOBAR_LABEL, |
| 229 base::UTF8ToUTF16(client_name_)); | 229 base::UTF8ToUTF16(client_name_)); |
| 230 } | 230 } |
| 231 | 231 |
| 232 int ExtensionDevToolsInfoBarDelegate::GetButtons() const { | 232 int ExtensionDevToolsInfoBarDelegate::GetButtons() const { |
| 233 return BUTTON_CANCEL; | 233 return BUTTON_CANCEL; |
| 234 } | 234 } |
| 235 | 235 |
| 236 bool ExtensionDevToolsInfoBarDelegate::Cancel() { | 236 bool ExtensionDevToolsInfoBarDelegate::Cancel() { |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 const std::vector<DevToolsTargetImpl*>& target_list) { | 745 const std::vector<DevToolsTargetImpl*>& target_list) { |
| 746 scoped_ptr<base::ListValue> result(new base::ListValue()); | 746 scoped_ptr<base::ListValue> result(new base::ListValue()); |
| 747 for (size_t i = 0; i < target_list.size(); ++i) | 747 for (size_t i = 0; i < target_list.size(); ++i) |
| 748 result->Append(SerializeTarget(*target_list[i])); | 748 result->Append(SerializeTarget(*target_list[i])); |
| 749 STLDeleteContainerPointers(target_list.begin(), target_list.end()); | 749 STLDeleteContainerPointers(target_list.begin(), target_list.end()); |
| 750 SetResult(result.release()); | 750 SetResult(result.release()); |
| 751 SendResponse(true); | 751 SendResponse(true); |
| 752 } | 752 } |
| 753 | 753 |
| 754 } // namespace extensions | 754 } // namespace extensions |
| OLD | NEW |