OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 // No need to remove previous bubble. It will close itself. | 1271 // No need to remove previous bubble. It will close itself. |
1272 PermissionBubbleManager* manager(nullptr); | 1272 PermissionBubbleManager* manager(nullptr); |
1273 if (oldContents) { | 1273 if (oldContents) { |
1274 manager = PermissionBubbleManager::FromWebContents(oldContents); | 1274 manager = PermissionBubbleManager::FromWebContents(oldContents); |
1275 if (manager) | 1275 if (manager) |
1276 manager->SetView(nullptr); | 1276 manager->SetView(nullptr); |
1277 } | 1277 } |
1278 | 1278 |
1279 if (newContents) { | 1279 if (newContents) { |
1280 if (!permissionBubbleCocoa_.get()) { | 1280 if (!permissionBubbleCocoa_.get()) { |
1281 permissionBubbleCocoa_.reset(new PermissionBubbleCocoa([self window])); | 1281 DCHECK(browser_.get()); |
| 1282 permissionBubbleCocoa_.reset(new PermissionBubbleCocoa(browser_.get())); |
1282 } | 1283 } |
1283 manager = PermissionBubbleManager::FromWebContents(newContents); | 1284 manager = PermissionBubbleManager::FromWebContents(newContents); |
1284 if (manager) | 1285 if (manager) |
1285 manager->SetView(permissionBubbleCocoa_.get()); | 1286 manager->SetView(permissionBubbleCocoa_.get()); |
1286 } | 1287 } |
1287 } | 1288 } |
1288 | 1289 |
1289 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { | 1290 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble { |
1290 [toolbarController_ zoomChangedForActiveTab:canShowBubble]; | 1291 [toolbarController_ zoomChangedForActiveTab:canShowBubble]; |
1291 } | 1292 } |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2231 | 2232 |
2232 - (BOOL)supportsBookmarkBar { | 2233 - (BOOL)supportsBookmarkBar { |
2233 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2234 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2234 } | 2235 } |
2235 | 2236 |
2236 - (BOOL)isTabbedWindow { | 2237 - (BOOL)isTabbedWindow { |
2237 return browser_->is_type_tabbed(); | 2238 return browser_->is_type_tabbed(); |
2238 } | 2239 } |
2239 | 2240 |
2240 @end // @implementation BrowserWindowController(WindowType) | 2241 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |