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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 25305002: Implement initial chrome.browserAction.openPopup API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <string> 8 #include <string>
9 9
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (popup && ![popup isClosing]) 197 if (popup && ![popup isClosing])
198 [popup close]; 198 [popup close];
199 199
200 break; 200 break;
201 } 201 }
202 case chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC: { 202 case chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC: {
203 std::pair<const std::string, gfx::NativeWindow>* payload = 203 std::pair<const std::string, gfx::NativeWindow>* payload =
204 content::Details<std::pair<const std::string, gfx::NativeWindow> >( 204 content::Details<std::pair<const std::string, gfx::NativeWindow> >(
205 details).ptr(); 205 details).ptr();
206 std::string extension_id = payload->first; 206 std::string extension_id = payload->first;
207 gfx::NativeWindow window = payload->second; 207 // gfx::NativeWindow window = payload->second;
208 if (window != browser_->window()->GetNativeWindow()) 208 // if (window != browser_->window()->GetNativeWindow())
209 break; 209 // break;
210 // gfx::NativeWindow window = browser_->window()->GetNativeWindow();
210 ExtensionService* service = browser_->profile()->GetExtensionService(); 211 ExtensionService* service = browser_->profile()->GetExtensionService();
211 if (!service) 212 if (!service)
212 break; 213 break;
213 const Extension* extension = service->GetExtensionById(extension_id, 214 const Extension* extension = service->GetExtensionById(extension_id,
214 false); 215 false);
215 if (!extension) 216 if (!extension)
216 break; 217 break;
217 BrowserActionButton* button = [owner_ buttonForExtension:extension]; 218 BrowserActionButton* button = [owner_ buttonForExtension:extension];
218 // |button| can be nil when the browser action has its button hidden. 219 // |button| can be nil when the browser action has its button hidden.
219 if (button) 220 if (button)
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 const extensions::ExtensionList& toolbar_items = 864 const extensions::ExtensionList& toolbar_items =
864 toolbarModel_->toolbar_items(); 865 toolbarModel_->toolbar_items();
865 if (index < toolbar_items.size()) { 866 if (index < toolbar_items.size()) {
866 const Extension* extension = toolbar_items[index].get(); 867 const Extension* extension = toolbar_items[index].get();
867 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; 868 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())];
868 } 869 }
869 return nil; 870 return nil;
870 } 871 }
871 872
872 @end 873 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698