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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 #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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 413
414 void BrowserWindowCocoa::RotatePaneFocus(bool forwards) { 414 void BrowserWindowCocoa::RotatePaneFocus(bool forwards) {
415 // Not needed on the Mac. 415 // Not needed on the Mac.
416 } 416 }
417 417
418 void BrowserWindowCocoa::FocusBookmarksToolbar() { 418 void BrowserWindowCocoa::FocusBookmarksToolbar() {
419 // Not needed on the Mac. 419 // Not needed on the Mac.
420 } 420 }
421 421
422
423 bool BrowserWindowCocoa::IsBookmarkBarVisible() const { 422 bool BrowserWindowCocoa::IsBookmarkBarVisible() const {
424 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); 423 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar);
425 } 424 }
426 425
427 bool BrowserWindowCocoa::IsBookmarkBarAnimating() const { 426 bool BrowserWindowCocoa::IsBookmarkBarAnimating() const {
428 return [controller_ isBookmarkBarAnimating]; 427 return [controller_ isBookmarkBarAnimating];
429 } 428 }
430 429
431 bool BrowserWindowCocoa::IsTabStripEditable() const { 430 bool BrowserWindowCocoa::IsTabStripEditable() const {
432 return ![controller_ isDragSessionActive]; 431 return ![controller_ isDragSessionActive];
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 if (!web_contents) 655 if (!web_contents)
657 return NULL; 656 return NULL;
658 extensions::TabHelper* tab_helper = 657 extensions::TabHelper* tab_helper =
659 extensions::TabHelper::FromWebContents(web_contents); 658 extensions::TabHelper::FromWebContents(web_contents);
660 return tab_helper ? tab_helper->active_tab_permission_granter() : NULL; 659 return tab_helper ? tab_helper->active_tab_permission_granter() : NULL;
661 } 660 }
662 661
663 void BrowserWindowCocoa::ModeChanged( 662 void BrowserWindowCocoa::ModeChanged(
664 const chrome::search::Mode& old_mode, 663 const chrome::search::Mode& old_mode,
665 const chrome::search::Mode& new_mode) { 664 const chrome::search::Mode& new_mode) {
666 [controller_ updateBookmarkBarStateForInstantPreview]; 665 [controller_ updateBookmarkBarStateForInstantOverlay];
667 } 666 }
668 667
669 void BrowserWindowCocoa::DestroyBrowser() { 668 void BrowserWindowCocoa::DestroyBrowser() {
670 [controller_ destroyBrowser]; 669 [controller_ destroyBrowser];
671 670
672 // at this point the controller is dead (autoreleased), so 671 // at this point the controller is dead (autoreleased), so
673 // make sure we don't try to reference it any more. 672 // make sure we don't try to reference it any more.
674 } 673 }
675 674
676 NSWindow* BrowserWindowCocoa::window() const { 675 NSWindow* BrowserWindowCocoa::window() const {
(...skipping 30 matching lines...) Expand all
707 PasswordGenerationBubbleController* controller = 706 PasswordGenerationBubbleController* controller =
708 [[PasswordGenerationBubbleController alloc] 707 [[PasswordGenerationBubbleController alloc]
709 initWithWindow:browser_->window()->GetNativeWindow() 708 initWithWindow:browser_->window()->GetNativeWindow()
710 anchoredAt:point 709 anchoredAt:point
711 renderViewHost:web_contents->GetRenderViewHost() 710 renderViewHost:web_contents->GetRenderViewHost()
712 passwordManager:PasswordManager::FromWebContents(web_contents) 711 passwordManager:PasswordManager::FromWebContents(web_contents)
713 usingGenerator:password_generator 712 usingGenerator:password_generator
714 forForm:form]; 713 forForm:form];
715 [controller showWindow:nil]; 714 [controller showWindow:nil];
716 } 715 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698