| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extension_page_actions_module.h" | 5 #include "chrome/browser/extensions/extension_page_actions_module.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "chrome/browser/browser.h" | |
| 9 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/profile.h" | |
| 11 #include "chrome/browser/extensions/extension_page_actions_module_constants.h" | 9 #include "chrome/browser/extensions/extension_page_actions_module_constants.h" |
| 12 #include "chrome/browser/extensions/extension_tabs_module.h" | 10 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 13 #include "chrome/browser/extensions/extensions_service.h" | 11 #include "chrome/browser/extensions/extensions_service.h" |
| 12 #include "chrome/browser/profile.h" |
| 14 #include "chrome/browser/tab_contents/navigation_entry.h" | 13 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 15 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
| 17 #include "chrome/common/extensions/extension_action.h" | 17 #include "chrome/common/extensions/extension_action.h" |
| 18 #include "chrome/common/extensions/extension_error_utils.h" | 18 #include "chrome/common/extensions/extension_error_utils.h" |
| 19 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
| 20 | 20 |
| 21 namespace keys = extension_page_actions_module_constants; | 21 namespace keys = extension_page_actions_module_constants; |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 // Errors. | 24 // Errors. |
| 25 const char kNoTabError[] = "No tab with id: *."; | 25 const char kNoTabError[] = "No tab with id: *."; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (!InitCommon(tab_id)) | 278 if (!InitCommon(tab_id)) |
| 279 return false; | 279 return false; |
| 280 | 280 |
| 281 std::string text; | 281 std::string text; |
| 282 EXTENSION_FUNCTION_VALIDATE(args->GetString("text", &text)); | 282 EXTENSION_FUNCTION_VALIDATE(args->GetString("text", &text)); |
| 283 | 283 |
| 284 page_action_->SetBadgeText(tab_id, text); | 284 page_action_->SetBadgeText(tab_id, text); |
| 285 contents_->PageActionStateChanged(); | 285 contents_->PageActionStateChanged(); |
| 286 return true; | 286 return true; |
| 287 } | 287 } |
| OLD | NEW |