| OLD | NEW |
| 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 <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/scoped_nsdisable_screen_updates.h" | 9 #include "base/scoped_nsdisable_screen_updates.h" |
| 10 #import "base/scoped_nsobject.h" | 10 #import "base/scoped_nsobject.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "chrome/app/chrome_dll_resource.h" // IDC_* | 12 #include "chrome/app/chrome_dll_resource.h" // IDC_* |
| 13 #include "chrome/browser/bookmarks/bookmark_editor.h" | 13 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 14 #include "chrome/browser/browser.h" | 14 #include "chrome/browser/browser.h" |
| 15 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/browser_theme_provider.h" |
| 17 #include "chrome/browser/dock_info.h" | 18 #include "chrome/browser/dock_info.h" |
| 18 #include "chrome/browser/encoding_menu_controller.h" | 19 #include "chrome/browser/encoding_menu_controller.h" |
| 19 #include "chrome/browser/location_bar.h" | 20 #include "chrome/browser/location_bar.h" |
| 20 #include "chrome/browser/profile.h" | 21 #include "chrome/browser/profile.h" |
| 21 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 22 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 22 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents_view.h" | 24 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 24 #include "chrome/browser/tabs/tab_strip_model.h" | 25 #include "chrome/browser/tabs/tab_strip_model.h" |
| 26 #import "chrome/browser/cocoa/background_gradient_view.h" |
| 25 #import "chrome/browser/cocoa/bookmark_bar_controller.h" | 27 #import "chrome/browser/cocoa/bookmark_bar_controller.h" |
| 26 #import "chrome/browser/cocoa/bookmark_editor_controller.h" | 28 #import "chrome/browser/cocoa/bookmark_editor_controller.h" |
| 27 #import "chrome/browser/cocoa/browser_window_cocoa.h" | 29 #import "chrome/browser/cocoa/browser_window_cocoa.h" |
| 28 #import "chrome/browser/cocoa/browser_window_controller.h" | 30 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 29 #import "chrome/browser/cocoa/chrome_browser_window.h" | 31 #import "chrome/browser/cocoa/chrome_browser_window.h" |
| 30 #import "chrome/browser/cocoa/download_shelf_controller.h" | 32 #import "chrome/browser/cocoa/download_shelf_controller.h" |
| 31 #import "chrome/browser/cocoa/event_utils.h" | 33 #import "chrome/browser/cocoa/event_utils.h" |
| 32 #import "chrome/browser/cocoa/extension_shelf_controller.h" | 34 #import "chrome/browser/cocoa/extension_shelf_controller.h" |
| 33 #import "chrome/browser/cocoa/fast_resize_view.h" | 35 #import "chrome/browser/cocoa/fast_resize_view.h" |
| 34 #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" | 36 #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" |
| 35 #include "chrome/browser/cocoa/find_bar_bridge.h" | 37 #include "chrome/browser/cocoa/find_bar_bridge.h" |
| 36 #import "chrome/browser/cocoa/fullscreen_window.h" | 38 #import "chrome/browser/cocoa/fullscreen_window.h" |
| 37 #import "chrome/browser/cocoa/infobar_container_controller.h" | 39 #import "chrome/browser/cocoa/infobar_container_controller.h" |
| 38 #import "chrome/browser/cocoa/status_bubble_mac.h" | 40 #import "chrome/browser/cocoa/status_bubble_mac.h" |
| 39 #import "chrome/browser/cocoa/tab_strip_model_observer_bridge.h" | 41 #import "chrome/browser/cocoa/tab_strip_model_observer_bridge.h" |
| 40 #import "chrome/browser/cocoa/tab_strip_view.h" | 42 #import "chrome/browser/cocoa/tab_strip_view.h" |
| 41 #import "chrome/browser/cocoa/tab_strip_controller.h" | 43 #import "chrome/browser/cocoa/tab_strip_controller.h" |
| 42 #import "chrome/browser/cocoa/tab_view.h" | 44 #import "chrome/browser/cocoa/tab_view.h" |
| 43 #import "chrome/browser/cocoa/toolbar_controller.h" | 45 #import "chrome/browser/cocoa/toolbar_controller.h" |
| 44 #import "chrome/browser/browser_theme_provider.h" | 46 #include "chrome/browser/net/url_fixer_upper.h" |
| 45 #include "chrome/browser/sync/profile_sync_service.h" | 47 #include "chrome/browser/sync/profile_sync_service.h" |
| 46 #include "chrome/browser/sync/sync_ui_util_mac.h" | 48 #include "chrome/browser/sync/sync_ui_util_mac.h" |
| 47 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 48 #include "chrome/common/pref_service.h" | 50 #include "chrome/common/pref_service.h" |
| 49 #import "chrome/browser/cocoa/background_gradient_view.h" | |
| 50 #include "grit/generated_resources.h" | 51 #include "grit/generated_resources.h" |
| 51 #include "grit/theme_resources.h" | 52 #include "grit/theme_resources.h" |
| 52 #import "third_party/GTM/AppKit/GTMTheme.h" | 53 #import "third_party/GTM/AppKit/GTMTheme.h" |
| 53 | 54 |
| 54 // Notes on self-inflicted (not user-inflicted) window resizing and moving: | 55 // Notes on self-inflicted (not user-inflicted) window resizing and moving: |
| 55 // | 56 // |
| 56 // When the bookmark bar goes from hidden to shown (on a non-NTP) page, or when | 57 // When the bookmark bar goes from hidden to shown (on a non-NTP) page, or when |
| 57 // the download shelf goes from hidden to shown, we grow the window downwards in | 58 // the download shelf goes from hidden to shown, we grow the window downwards in |
| 58 // order to maintain a constant content area size. When either goes from shown | 59 // order to maintain a constant content area size. When either goes from shown |
| 59 // to hidden, we consequently shrink the window from the bottom, also to keep | 60 // to hidden, we consequently shrink the window from the bottom, also to keep |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 [controller getDesiredToolbarHeightCompression]]; | 1393 [controller getDesiredToolbarHeightCompression]]; |
| 1393 } | 1394 } |
| 1394 | 1395 |
| 1395 // (Private/TestingAPI) | 1396 // (Private/TestingAPI) |
| 1396 - (void)resetWindowGrowthState { | 1397 - (void)resetWindowGrowthState { |
| 1397 windowTopGrowth_ = 0; | 1398 windowTopGrowth_ = 0; |
| 1398 windowBottomGrowth_ = 0; | 1399 windowBottomGrowth_ = 0; |
| 1399 isShrinkingFromZoomed_ = NO; | 1400 isShrinkingFromZoomed_ = NO; |
| 1400 } | 1401 } |
| 1401 | 1402 |
| 1403 // Our implementation of the |URLDropTargetWindowController| protocol just |
| 1404 // reflects everything to the |tabStripController_|. |
| 1405 - (void)dropURLs:(NSArray*)urls at:(NSPoint)location { |
| 1406 [tabStripController_ dropURLs:urls at:location]; |
| 1407 } |
| 1408 |
| 1409 - (void)indicateDropURLsAt:(NSPoint)location { |
| 1410 [tabStripController_ indicateDropURLsAt:location]; |
| 1411 } |
| 1412 |
| 1413 - (void)hideDropURLsIndicator { |
| 1414 [tabStripController_ hideDropURLsIndicator]; |
| 1415 } |
| 1416 |
| 1402 @end | 1417 @end |
| 1403 | 1418 |
| 1404 @implementation BrowserWindowController (Private) | 1419 @implementation BrowserWindowController (Private) |
| 1405 | 1420 |
| 1406 // If the browser is in incognito mode, install the image view to decorate | 1421 // If the browser is in incognito mode, install the image view to decorate |
| 1407 // the window at the upper right. Use the same base y coordinate as the | 1422 // the window at the upper right. Use the same base y coordinate as the |
| 1408 // tab strip. | 1423 // tab strip. |
| 1409 - (void)installIncognitoBadge { | 1424 - (void)installIncognitoBadge { |
| 1410 if (!browser_->profile()->IsOffTheRecord()) | 1425 if (!browser_->profile()->IsOffTheRecord()) |
| 1411 return; | 1426 return; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 if (frameOverlayInactiveImage) { | 1867 if (frameOverlayInactiveImage) { |
| 1853 [theme setValue:frameOverlayInactiveImage | 1868 [theme setValue:frameOverlayInactiveImage |
| 1854 forAttribute:@"overlay" | 1869 forAttribute:@"overlay" |
| 1855 style:GTMThemeStyleWindow | 1870 style:GTMThemeStyleWindow |
| 1856 state:GTMThemeStateInactiveWindow]; | 1871 state:GTMThemeStateInactiveWindow]; |
| 1857 } | 1872 } |
| 1858 | 1873 |
| 1859 return theme; | 1874 return theme; |
| 1860 } | 1875 } |
| 1861 @end | 1876 @end |
| OLD | NEW |