| OLD | NEW |
| 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/ui/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 BrowserWindowCocoa::GetActiveTabPermissionGranter() { | 658 BrowserWindowCocoa::GetActiveTabPermissionGranter() { |
| 659 WebContents* web_contents = | 659 WebContents* web_contents = |
| 660 browser_->tab_strip_model()->GetActiveWebContents(); | 660 browser_->tab_strip_model()->GetActiveWebContents(); |
| 661 if (!web_contents) | 661 if (!web_contents) |
| 662 return NULL; | 662 return NULL; |
| 663 extensions::TabHelper* tab_helper = | 663 extensions::TabHelper* tab_helper = |
| 664 extensions::TabHelper::FromWebContents(web_contents); | 664 extensions::TabHelper::FromWebContents(web_contents); |
| 665 return tab_helper ? tab_helper->active_tab_permission_granter() : NULL; | 665 return tab_helper ? tab_helper->active_tab_permission_granter() : NULL; |
| 666 } | 666 } |
| 667 | 667 |
| 668 void BrowserWindowCocoa::ModeChanged( | 668 void BrowserWindowCocoa::ModelChanged( |
| 669 const chrome::search::Mode& old_mode, | 669 const chrome::search::SearchModel::State& old_state, |
| 670 const chrome::search::Mode& new_mode) { | 670 const chrome::search::SearchModel::State& new_state) { |
| 671 [controller_ updateBookmarkBarStateForInstantOverlay]; | 671 [controller_ updateBookmarkBarStateForInstantOverlay]; |
| 672 } | 672 } |
| 673 | 673 |
| 674 void BrowserWindowCocoa::DestroyBrowser() { | 674 void BrowserWindowCocoa::DestroyBrowser() { |
| 675 [controller_ destroyBrowser]; | 675 [controller_ destroyBrowser]; |
| 676 | 676 |
| 677 // at this point the controller is dead (autoreleased), so | 677 // at this point the controller is dead (autoreleased), so |
| 678 // make sure we don't try to reference it any more. | 678 // make sure we don't try to reference it any more. |
| 679 } | 679 } |
| 680 | 680 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 PasswordGenerationBubbleController* controller = | 712 PasswordGenerationBubbleController* controller = |
| 713 [[PasswordGenerationBubbleController alloc] | 713 [[PasswordGenerationBubbleController alloc] |
| 714 initWithWindow:browser_->window()->GetNativeWindow() | 714 initWithWindow:browser_->window()->GetNativeWindow() |
| 715 anchoredAt:point | 715 anchoredAt:point |
| 716 renderViewHost:web_contents->GetRenderViewHost() | 716 renderViewHost:web_contents->GetRenderViewHost() |
| 717 passwordManager:PasswordManager::FromWebContents(web_contents) | 717 passwordManager:PasswordManager::FromWebContents(web_contents) |
| 718 usingGenerator:password_generator | 718 usingGenerator:password_generator |
| 719 forForm:form]; | 719 forForm:form]; |
| 720 [controller showWindow:nil]; | 720 [controller showWindow:nil]; |
| 721 } | 721 } |
| OLD | NEW |