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

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

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (extension-notifications) rebase Created 6 years, 4 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 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 withObject:nil 120 withObject:nil
121 afterDelay:0.0]; 121 afterDelay:0.0];
122 } 122 }
123 } 123 }
124 124
125 virtual void Observe( 125 virtual void Observe(
126 int type, 126 int type,
127 const content::NotificationSource& source, 127 const content::NotificationSource& source,
128 const content::NotificationDetails& details) OVERRIDE { 128 const content::NotificationDetails& details) OVERRIDE {
129 switch (type) { 129 switch (type) {
130 case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: { 130 case extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: {
131 if (content::Details<extensions::ExtensionViewHost>( 131 if (content::Details<extensions::ExtensionViewHost>(
132 [controller_ extensionViewHost]) == details) { 132 [controller_ extensionViewHost]) == details) {
133 [controller_ showDevTools]; 133 [controller_ showDevTools];
134 } 134 }
135 break; 135 break;
136 } 136 }
137 default: { 137 default: {
138 NOTREACHED() << "Received unexpected notification"; 138 NOTREACHED() << "Received unexpected notification";
139 break; 139 break;
140 } 140 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 object:extensionView_]; 188 object:extensionView_];
189 189
190 [view addSubview:extensionView_]; 190 [view addSubview:extensionView_];
191 191
192 notificationBridge_.reset(new DevtoolsNotificationBridge(self)); 192 notificationBridge_.reset(new DevtoolsNotificationBridge(self));
193 registrar_.reset(new content::NotificationRegistrar); 193 registrar_.reset(new content::NotificationRegistrar);
194 if (beingInspected_) { 194 if (beingInspected_) {
195 // Listen for the extension to finish loading so the dev tools can be 195 // Listen for the extension to finish loading so the dev tools can be
196 // opened. 196 // opened.
197 registrar_->Add(notificationBridge_.get(), 197 registrar_->Add(notificationBridge_.get(),
198 chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, 198 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
199 content::Source<BrowserContext>(host->browser_context())); 199 content::Source<BrowserContext>(host->browser_context()));
200 } 200 }
201 } 201 }
202 return self; 202 return self;
203 } 203 }
204 204
205 - (void)dealloc { 205 - (void)dealloc {
206 [[NSNotificationCenter defaultCenter] removeObserver:self]; 206 [[NSNotificationCenter defaultCenter] removeObserver:self];
207 [super dealloc]; 207 [super dealloc];
208 } 208 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 return minSize; 431 return minSize;
432 } 432 }
433 433
434 // Private (TestingAPI) 434 // Private (TestingAPI)
435 + (NSSize)maxPopupSize { 435 + (NSSize)maxPopupSize {
436 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; 436 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight};
437 return maxSize; 437 return maxSize;
438 } 438 }
439 439
440 @end 440 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698