| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); | 442 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); |
| 443 } | 443 } |
| 444 | 444 |
| 445 gfx::Rect BrowserWindowCocoa::GetRootWindowResizerRect() const { | 445 gfx::Rect BrowserWindowCocoa::GetRootWindowResizerRect() const { |
| 446 if (IsDownloadShelfVisible()) | 446 if (IsDownloadShelfVisible()) |
| 447 return gfx::Rect(); | 447 return gfx::Rect(); |
| 448 NSRect tabRect = [controller_ selectedTabGrowBoxRect]; | 448 NSRect tabRect = [controller_ selectedTabGrowBoxRect]; |
| 449 return gfx::Rect(NSRectToCGRect(tabRect)); | 449 return gfx::Rect(NSRectToCGRect(tabRect)); |
| 450 } | 450 } |
| 451 | 451 |
| 452 bool BrowserWindowCocoa::IsPanel() const { | |
| 453 return false; | |
| 454 } | |
| 455 | |
| 456 // This is called from Browser, which in turn is called directly from | 452 // This is called from Browser, which in turn is called directly from |
| 457 // a menu option. All we do here is set a preference. The act of | 453 // a menu option. All we do here is set a preference. The act of |
| 458 // setting the preference sends notifications to all windows who then | 454 // setting the preference sends notifications to all windows who then |
| 459 // know what to do. | 455 // know what to do. |
| 460 void BrowserWindowCocoa::ToggleBookmarkBar() { | 456 void BrowserWindowCocoa::ToggleBookmarkBar() { |
| 461 chrome::ToggleBookmarkBarWhenVisible(browser_->profile()); | 457 chrome::ToggleBookmarkBarWhenVisible(browser_->profile()); |
| 462 } | 458 } |
| 463 | 459 |
| 464 void BrowserWindowCocoa::AddFindBar( | 460 void BrowserWindowCocoa::AddFindBar( |
| 465 FindBarCocoaController* find_bar_cocoa_controller) { | 461 FindBarCocoaController* find_bar_cocoa_controller) { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 PasswordGenerationBubbleController* controller = | 700 PasswordGenerationBubbleController* controller = |
| 705 [[PasswordGenerationBubbleController alloc] | 701 [[PasswordGenerationBubbleController alloc] |
| 706 initWithWindow:browser_->window()->GetNativeWindow() | 702 initWithWindow:browser_->window()->GetNativeWindow() |
| 707 anchoredAt:point | 703 anchoredAt:point |
| 708 renderViewHost:web_contents->GetRenderViewHost() | 704 renderViewHost:web_contents->GetRenderViewHost() |
| 709 passwordManager:PasswordManager::FromWebContents(web_contents) | 705 passwordManager:PasswordManager::FromWebContents(web_contents) |
| 710 usingGenerator:password_generator | 706 usingGenerator:password_generator |
| 711 forForm:form]; | 707 forForm:form]; |
| 712 [controller showWindow:nil]; | 708 [controller showWindow:nil]; |
| 713 } | 709 } |
| OLD | NEW |