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

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

Issue 495010: Mac: fix/implement app windows (not app mode), popups, drawing; refactor code. (Closed)
Patch Set: Updated per pink's review. Created 11 years 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/l10n_util_mac.h" 5 #include "app/l10n_util_mac.h"
6 #include "base/gfx/rect.h" 6 #include "base/gfx/rect.h"
7 #include "base/keyboard_codes.h" 7 #include "base/keyboard_codes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/app/chrome_dll_resource.h" 10 #include "chrome/app/chrome_dll_resource.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return gfx::Rect(NSRectToCGRect(tabRect)); 190 return gfx::Rect(NSRectToCGRect(tabRect));
191 } 191 }
192 192
193 void BrowserWindowCocoa::ConfirmAddSearchProvider( 193 void BrowserWindowCocoa::ConfirmAddSearchProvider(
194 const TemplateURL* template_url, 194 const TemplateURL* template_url,
195 Profile* profile) { 195 Profile* profile) {
196 NOTIMPLEMENTED(); 196 NOTIMPLEMENTED();
197 } 197 }
198 198
199 LocationBar* BrowserWindowCocoa::GetLocationBar() const { 199 LocationBar* BrowserWindowCocoa::GetLocationBar() const {
200 return [controller_ locationBar]; 200 return [controller_ locationBarBridge];
201 } 201 }
202 202
203 void BrowserWindowCocoa::SetFocusToLocationBar() { 203 void BrowserWindowCocoa::SetFocusToLocationBar() {
204 [controller_ focusLocationBar]; 204 [controller_ focusLocationBar];
205 } 205 }
206 206
207 void BrowserWindowCocoa::UpdateStopGoState(bool is_loading, bool force) { 207 void BrowserWindowCocoa::UpdateStopGoState(bool is_loading, bool force) {
208 [controller_ setIsLoading:is_loading ? YES : NO]; 208 [controller_ setIsLoading:is_loading ? YES : NO];
209 } 209 }
210 210
211 void BrowserWindowCocoa::UpdateToolbar(TabContents* contents, 211 void BrowserWindowCocoa::UpdateToolbar(TabContents* contents,
212 bool should_restore_state) { 212 bool should_restore_state) {
213 [controller_ updateToolbarWithContents:contents 213 [controller_ updateToolbarWithContents:contents
214 shouldRestoreState:should_restore_state ? YES : NO]; 214 shouldRestoreState:should_restore_state ? YES : NO];
215 } 215 }
216 216
217 void BrowserWindowCocoa::FocusToolbar() { 217 void BrowserWindowCocoa::FocusToolbar() {
218 NOTIMPLEMENTED(); 218 NOTIMPLEMENTED();
219 } 219 }
220 220
221 bool BrowserWindowCocoa::IsBookmarkBarVisible() const { 221 bool BrowserWindowCocoa::IsBookmarkBarVisible() const {
222 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); 222 return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar);
223 } 223 }
224 224
225 bool BrowserWindowCocoa::IsToolbarVisible() const { 225 bool BrowserWindowCocoa::IsToolbarVisible() const {
226 NOTIMPLEMENTED(); 226 return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) ||
227 return true; 227 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR);
228 } 228 }
229 229
230 // This is called from Browser, which in turn is called directly from 230 // This is called from Browser, which in turn is called directly from
231 // a menu option. All we do here is set a preference. The act of 231 // a menu option. All we do here is set a preference. The act of
232 // setting the preference sends notifications to all windows who then 232 // setting the preference sends notifications to all windows who then
233 // know what to do. 233 // know what to do.
234 void BrowserWindowCocoa::ToggleBookmarkBar() { 234 void BrowserWindowCocoa::ToggleBookmarkBar() {
235 bookmark_utils::ToggleWhenVisible(browser_->profile()); 235 bookmark_utils::ToggleWhenVisible(browser_->profile());
236 } 236 }
237 237
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 break; 509 break;
510 } 510 }
511 } 511 }
512 512
513 void BrowserWindowCocoa::DestroyBrowser() { 513 void BrowserWindowCocoa::DestroyBrowser() {
514 [controller_ destroyBrowser]; 514 [controller_ destroyBrowser];
515 515
516 // at this point the controller is dead (autoreleased), so 516 // at this point the controller is dead (autoreleased), so
517 // make sure we don't try to reference it any more. 517 // make sure we don't try to reference it any more.
518 } 518 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller.mm ('k') | chrome/browser/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698