Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(874)

Side by Side Diff: chrome/browser/extensions/page_action_controller.cc

Issue 10559054: Animate the script badges. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move to extension action Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/extensions/page_action_controller.h" 5 #include "chrome/browser/extensions/page_action_controller.h"
6 6
7 #include "chrome/browser/extensions/extension_browser_event_router.h" 7 #include "chrome/browser/extensions/extension_browser_event_router.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/extension_tab_helper.h" 10 #include "chrome/browser/extensions/extension_tab_helper.h"
11 #include "chrome/browser/extensions/extension_tab_util.h" 11 #include "chrome/browser/extensions/extension_tab_util.h"
12 #include "chrome/browser/ui/tab_contents/tab_contents.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents.h"
13 #include "chrome/common/extensions/extension_set.h" 13 #include "chrome/common/extensions/extension_set.h"
14 #include "chrome/common/chrome_notification_types.h" 14 #include "chrome/common/chrome_notification_types.h"
15 #include "content/public/browser/notification_service.h" 15 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
17 17
18 namespace extensions { 18 namespace extensions {
19 19
20 PageActionController::PageActionController(TabContents* tab_contents) 20 PageActionController::PageActionController(TabContents* tab_contents)
21 : tab_contents_(tab_contents) {} 21 : tab_contents_(tab_contents) {}
22 22
23 PageActionController::~PageActionController() {} 23 PageActionController::~PageActionController() {}
24 24
25 std::vector<ExtensionAction*> PageActionController::GetCurrentActions() { 25 std::vector<ExtensionAction*> PageActionController::GetCurrentActions() const {
26 ExtensionService* service = GetExtensionService(); 26 ExtensionService* service = GetExtensionService();
27 if (!service) 27 if (!service)
28 return std::vector<ExtensionAction*>(); 28 return std::vector<ExtensionAction*>();
29 29
30 std::vector<ExtensionAction*> current_actions; 30 std::vector<ExtensionAction*> current_actions;
31 31
32 for (ExtensionSet::const_iterator i = service->extensions()->begin(); 32 for (ExtensionSet::const_iterator i = service->extensions()->begin();
33 i != service->extensions()->end(); ++i) { 33 i != service->extensions()->end(); ++i) {
34 ExtensionAction* action = (*i)->page_action(); 34 ExtensionAction* action = (*i)->page_action();
35 if (action) 35 if (action)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return ACTION_NONE; 68 return ACTION_NONE;
69 69
70 case 3: // right 70 case 3: // right
71 return extension->ShowConfigureContextMenus() ? 71 return extension->ShowConfigureContextMenus() ?
72 ACTION_SHOW_CONTEXT_MENU : ACTION_NONE; 72 ACTION_SHOW_CONTEXT_MENU : ACTION_NONE;
73 } 73 }
74 74
75 return ACTION_NONE; 75 return ACTION_NONE;
76 } 76 }
77 77
78 ExtensionService* PageActionController::GetExtensionService() { 78 ExtensionService* PageActionController::GetExtensionService() const {
79 return ExtensionSystem::Get(tab_contents_->profile())->extension_service(); 79 return ExtensionSystem::Get(tab_contents_->profile())->extension_service();
80 } 80 }
81 81
82 } // namespace extensions 82 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698