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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_window_cocoa.mm

Issue 7538010: Make BrowserWindow::CreateFindBar non-static so that it can be overridden by Panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove underscore. Created 9 years, 4 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) 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/panels/panel_browser_window_cocoa.h" 5 #include "chrome/browser/ui/panels/panel_browser_window_cocoa.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h"
9 #include "chrome/browser/ui/panels/panel.h" 10 #include "chrome/browser/ui/panels/panel.h"
10 #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" 11 #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h"
11 12
12 namespace { 13 namespace {
13 14
14 // Use this instead of 0 for minimum size of a window when doing opening and 15 // Use this instead of 0 for minimum size of a window when doing opening and
15 // closing animations, since OSX window manager does not like 0-sized windows 16 // closing animations, since OSX window manager does not like 0-sized windows
16 // (according to avi@). 17 // (according to avi@).
17 const int kMinimumWindowSize = 1; 18 const int kMinimumWindowSize = 1;
18 19
(...skipping 17 matching lines...) Expand all
36 const gfx::Rect& bounds) { 37 const gfx::Rect& bounds) {
37 return new PanelBrowserWindowCocoa(browser, panel, bounds); 38 return new PanelBrowserWindowCocoa(browser, panel, bounds);
38 } 39 }
39 40
40 PanelBrowserWindowCocoa::PanelBrowserWindowCocoa(Browser* browser, 41 PanelBrowserWindowCocoa::PanelBrowserWindowCocoa(Browser* browser,
41 Panel* panel, 42 Panel* panel,
42 const gfx::Rect& bounds) 43 const gfx::Rect& bounds)
43 : browser_(browser), 44 : browser_(browser),
44 panel_(panel), 45 panel_(panel),
45 bounds_(bounds), 46 bounds_(bounds),
46 is_shown_(false) { 47 is_shown_(false),
48 has_find_bar_(false) {
47 controller_ = [[PanelWindowControllerCocoa alloc] initWithBrowserWindow:this]; 49 controller_ = [[PanelWindowControllerCocoa alloc] initWithBrowserWindow:this];
48 } 50 }
49 51
50 PanelBrowserWindowCocoa::~PanelBrowserWindowCocoa() { 52 PanelBrowserWindowCocoa::~PanelBrowserWindowCocoa() {
51 } 53 }
52 54
53 bool PanelBrowserWindowCocoa::isClosed() { 55 bool PanelBrowserWindowCocoa::isClosed() {
54 return !controller_; 56 return !controller_;
55 } 57 }
56 58
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 129 }
128 130
129 void PanelBrowserWindowCocoa::UpdatePanelTitleBar() { 131 void PanelBrowserWindowCocoa::UpdatePanelTitleBar() {
130 NOTIMPLEMENTED(); 132 NOTIMPLEMENTED();
131 } 133 }
132 134
133 void PanelBrowserWindowCocoa::ShowTaskManagerForPanel() { 135 void PanelBrowserWindowCocoa::ShowTaskManagerForPanel() {
134 NOTIMPLEMENTED(); 136 NOTIMPLEMENTED();
135 } 137 }
136 138
139 FindBar* PanelBrowserWindowCocoa::CreatePanelFindBar() {
140 // Find bar should only be created once per panel!
141 DCHECK(!has_find_bar_);
Dmitry Titov 2011/08/08 20:08:31 It's nice to do it this way, but I don't have a st
jennb 2011/08/08 21:21:21 Done.
142 has_find_bar_ = true;
143
144 FindBarBridge* bridge = new FindBarBridge();
145 [controller_ addFindBar:bridge->find_bar_cocoa_controller()];
146 return bridge;
147 }
148
137 void PanelBrowserWindowCocoa::NotifyPanelOnUserChangedTheme() { 149 void PanelBrowserWindowCocoa::NotifyPanelOnUserChangedTheme() {
138 NOTIMPLEMENTED(); 150 NOTIMPLEMENTED();
139 } 151 }
140 152
141 void PanelBrowserWindowCocoa::DrawAttention() { 153 void PanelBrowserWindowCocoa::DrawAttention() {
142 NOTIMPLEMENTED(); 154 NOTIMPLEMENTED();
143 } 155 }
144 156
145 bool PanelBrowserWindowCocoa::IsDrawingAttention() const { 157 bool PanelBrowserWindowCocoa::IsDrawingAttention() const {
146 NOTIMPLEMENTED(); 158 NOTIMPLEMENTED();
147 return false; 159 return false;
148 } 160 }
149 161
150 Browser* PanelBrowserWindowCocoa::GetPanelBrowser() const { 162 Browser* PanelBrowserWindowCocoa::GetPanelBrowser() const {
151 return browser(); 163 return browser();
152 } 164 }
153 165
154 void PanelBrowserWindowCocoa::DestroyPanelBrowser() { 166 void PanelBrowserWindowCocoa::DestroyPanelBrowser() {
155 [controller_ close]; 167 [controller_ close];
156 controller_ = NULL; 168 controller_ = NULL;
157 } 169 }
158 170
159 NativePanelTesting* PanelBrowserWindowCocoa::GetNativePanelTesting() { 171 NativePanelTesting* PanelBrowserWindowCocoa::GetNativePanelTesting() {
160 return this; 172 return this;
161 } 173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698