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

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

Issue 6386009: Remove app/win/win_util.h,cc etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with NSApp changes in r73581 Created 9 years, 10 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/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/mac/mac_util.h"
11 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
12 #include "chrome/app/chrome_command_ids.h" 11 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/bookmarks/bookmark_utils.h" 12 #include "chrome/browser/bookmarks/bookmark_utils.h"
14 #include "chrome/browser/download/download_shelf.h" 13 #include "chrome/browser/download/download_shelf.h"
15 #include "chrome/browser/global_keyboard_shortcuts_mac.h" 14 #include "chrome/browser/global_keyboard_shortcuts_mac.h"
16 #include "chrome/browser/page_info_window.h" 15 #include "chrome/browser/page_info_window.h"
17 #include "chrome/browser/prefs/pref_service.h" 16 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/sidebar/sidebar_container.h" 18 #include "chrome/browser/sidebar/sidebar_container.h"
20 #include "chrome/browser/sidebar/sidebar_manager.h" 19 #include "chrome/browser/sidebar/sidebar_manager.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 gfx::Rect BrowserWindowCocoa::GetInstantBounds() { 592 gfx::Rect BrowserWindowCocoa::GetInstantBounds() {
594 // Flip coordinates based on the primary screen. 593 // Flip coordinates based on the primary screen.
595 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 594 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
596 NSRect monitorFrame = [screen frame]; 595 NSRect monitorFrame = [screen frame];
597 NSRect frame = [controller_ instantFrame]; 596 NSRect frame = [controller_ instantFrame];
598 gfx::Rect bounds(NSRectToCGRect(frame)); 597 gfx::Rect bounds(NSRectToCGRect(frame));
599 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height()); 598 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height());
600 return bounds; 599 return bounds;
601 } 600 }
602 601
603 gfx::Rect BrowserWindowCocoa::GrabWindowSnapshot(std::vector<unsigned char>*
604 png_representation) {
605 int width = 0, height = 0;
606 base::mac::GrabWindowSnapshot(window(), png_representation, &width, &height);
607 return gfx::Rect(width, height);
608 }
609
610 void BrowserWindowCocoa::Observe(NotificationType type, 602 void BrowserWindowCocoa::Observe(NotificationType type,
611 const NotificationSource& source, 603 const NotificationSource& source,
612 const NotificationDetails& details) { 604 const NotificationDetails& details) {
613 switch (type.value) { 605 switch (type.value) {
614 // Only the key window gets a direct toggle from the menu. 606 // Only the key window gets a direct toggle from the menu.
615 // Other windows hear about it from the notification. 607 // Other windows hear about it from the notification.
616 case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: 608 case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
617 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; 609 [controller_ updateBookmarkBarVisibilityWithAnimation:YES];
618 break; 610 break;
619 case NotificationType::SIDEBAR_CHANGED: 611 case NotificationType::SIDEBAR_CHANGED:
(...skipping 15 matching lines...) Expand all
635 627
636 NSWindow* BrowserWindowCocoa::window() const { 628 NSWindow* BrowserWindowCocoa::window() const {
637 return [controller_ window]; 629 return [controller_ window];
638 } 630 }
639 631
640 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { 632 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) {
641 if (tab_contents == browser_->GetSelectedTabContents()) { 633 if (tab_contents == browser_->GetSelectedTabContents()) {
642 [controller_ updateSidebarForContents:tab_contents]; 634 [controller_ updateSidebarForContents:tab_contents];
643 } 635 }
644 } 636 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/cocoa/bug_report_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698