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

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

Issue 10544195: Show an extension info bubble when a script badge is clicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
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/script_badge_controller.h" 5 #include "chrome/browser/extensions/script_badge_controller.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/extension_system.h" 8 #include "chrome/browser/extensions/extension_system.h"
9 #include "chrome/browser/ui/tab_contents/tab_contents.h" 9 #include "chrome/browser/ui/tab_contents/tab_contents.h"
10 #include "chrome/common/extensions/extension.h" 10 #include "chrome/common/extensions/extension.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const std::string& extension_id, int mouse_button) { 50 const std::string& extension_id, int mouse_button) {
51 ExtensionService* service = GetExtensionService(); 51 ExtensionService* service = GetExtensionService();
52 if (!service) 52 if (!service)
53 return ACTION_NONE; 53 return ACTION_NONE;
54 54
55 const Extension* extension = service->extensions()->GetByID(extension_id); 55 const Extension* extension = service->extensions()->GetByID(extension_id);
56 CHECK(extension); 56 CHECK(extension);
57 57
58 switch (mouse_button) { 58 switch (mouse_button) {
59 case 1: // left 59 case 1: // left
60 return ACTION_SHOW_SCRIPT_POPUP;
60 case 2: // middle 61 case 2: // middle
61 // TODO(kalman): decide what to do here. 62 // TODO(kalman): decide what to do here.
62 return ACTION_NONE; 63 return ACTION_NONE;
63 case 3: // right 64 case 3: // right
64 return extension->ShowConfigureContextMenus() ? 65 return extension->ShowConfigureContextMenus() ?
65 ACTION_SHOW_CONTEXT_MENU : ACTION_NONE; 66 ACTION_SHOW_CONTEXT_MENU : ACTION_NONE;
66 } 67 }
67 68
68 return ACTION_NONE; 69 return ACTION_NONE;
69 } 70 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (page_id == GetPageID()) { 143 if (page_id == GetPageID()) {
143 size_t original_size = extensions_executing_scripts_.size(); 144 size_t original_size = extensions_executing_scripts_.size();
144 extensions_executing_scripts_.insert(extension_ids.begin(), 145 extensions_executing_scripts_.insert(extension_ids.begin(),
145 extension_ids.end()); 146 extension_ids.end());
146 if (extensions_executing_scripts_.size() > original_size) 147 if (extensions_executing_scripts_.size() > original_size)
147 Notify(); 148 Notify();
148 } 149 }
149 } 150 }
150 151
151 } // namespace extensions 152 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698