OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 | 48 |
49 BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser, | 49 BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser, |
50 BrowserWindowController* controller, | 50 BrowserWindowController* controller, |
51 NSWindow* window) | 51 NSWindow* window) |
52 : browser_(browser), | 52 : browser_(browser), |
53 controller_(controller), | 53 controller_(controller), |
54 confirm_close_factory_(browser) { | 54 confirm_close_factory_(browser) { |
55 // This pref applies to all windows, so all must watch for it. | 55 // This pref applies to all windows, so all must watch for it. |
56 registrar_.Add(this, | 56 registrar_.Add(this, |
57 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, | 57 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
58 NotificationService::AllSources()); | 58 NotificationService::AllSources()); |
Peter Kasting
2011/08/10 21:03:21
Don't you want to change this (and the observer co
Elliot Glaysher
2011/08/10 21:19:23
I'm doing this in a per-notification way instead o
| |
59 registrar_.Add(this, chrome::NOTIFICATION_SIDEBAR_CHANGED, | 59 registrar_.Add(this, chrome::NOTIFICATION_SIDEBAR_CHANGED, |
60 NotificationService::AllSources()); | 60 Source<SidebarManager>(SidebarManager::GetInstance())); |
Peter Kasting
2011/08/10 21:03:21
Shouldn't the sidebar state be synced between norm
Elliot Glaysher
2011/08/10 21:19:23
The SidebarManager is currently a Singleton. It ma
| |
61 } | 61 } |
62 | 62 |
63 BrowserWindowCocoa::~BrowserWindowCocoa() { | 63 BrowserWindowCocoa::~BrowserWindowCocoa() { |
64 } | 64 } |
65 | 65 |
66 void BrowserWindowCocoa::Show() { | 66 void BrowserWindowCocoa::Show() { |
67 // The Browser associated with this browser window must become the active | 67 // The Browser associated with this browser window must become the active |
68 // browser at the time |Show()| is called. This is the natural behaviour under | 68 // browser at the time |Show()| is called. This is the natural behaviour under |
69 // Windows, but |-makeKeyAndOrderFront:| won't send |-windowDidBecomeMain:| | 69 // Windows, but |-makeKeyAndOrderFront:| won't send |-windowDidBecomeMain:| |
70 // until we return to the runloop. Therefore any calls to | 70 // until we return to the runloop. Therefore any calls to |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
629 | 629 |
630 NSWindow* BrowserWindowCocoa::window() const { | 630 NSWindow* BrowserWindowCocoa::window() const { |
631 return [controller_ window]; | 631 return [controller_ window]; |
632 } | 632 } |
633 | 633 |
634 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { | 634 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { |
635 if (tab_contents == browser_->GetSelectedTabContents()) { | 635 if (tab_contents == browser_->GetSelectedTabContents()) { |
636 [controller_ updateSidebarForContents:tab_contents]; | 636 [controller_ updateSidebarForContents:tab_contents]; |
637 } | 637 } |
638 } | 638 } |
OLD | NEW |