| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #import "chrome/browser/ui/cocoa/framed_browser_window.h" | 55 #import "chrome/browser/ui/cocoa/framed_browser_window.h" |
| 56 #import "chrome/browser/ui/cocoa/fullscreen_window.h" | 56 #import "chrome/browser/ui/cocoa/fullscreen_window.h" |
| 57 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" | 57 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
| 58 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" | 58 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" |
| 59 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 59 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
| 60 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" | 60 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" |
| 61 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" | 61 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" |
| 62 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" | 62 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" |
| 63 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" | 63 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 64 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" | 64 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
| 65 #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" | |
| 66 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" | 65 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
| 67 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 66 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 68 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 67 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 69 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" | 68 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
| 70 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 69 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 71 #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h" | 70 #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h" |
| 72 #include "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" | 71 #include "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h" |
| 73 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 72 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 74 #include "chrome/browser/ui/location_bar/location_bar.h" | 73 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 75 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 74 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 76 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 75 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 77 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" | 76 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" |
| 78 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" | 77 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" |
| 79 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 78 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 80 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 79 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 81 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
| 82 #include "chrome/common/extensions/command.h" | 81 #include "chrome/common/extensions/command.h" |
| 83 #include "chrome/common/url_constants.h" | |
| 84 #include "chrome/grit/generated_resources.h" | 82 #include "chrome/grit/generated_resources.h" |
| 85 #include "chrome/grit/locale_settings.h" | 83 #include "chrome/grit/locale_settings.h" |
| 86 #include "components/bookmarks/browser/bookmark_model.h" | 84 #include "components/bookmarks/browser/bookmark_model.h" |
| 85 #import "components/sad_tab/cocoa/sad_tab_controller.h" |
| 86 #include "components/sad_tab/url_constants.h" |
| 87 #include "components/signin/core/common/profile_management_switches.h" | 87 #include "components/signin/core/common/profile_management_switches.h" |
| 88 #include "components/translate/core/browser/translate_manager.h" | 88 #include "components/translate/core/browser/translate_manager.h" |
| 89 #include "components/translate/core/browser/translate_ui_delegate.h" | 89 #include "components/translate/core/browser/translate_ui_delegate.h" |
| 90 #include "components/web_modal/popup_manager.h" | 90 #include "components/web_modal/popup_manager.h" |
| 91 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 91 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 92 #include "content/public/browser/render_view_host.h" | 92 #include "content/public/browser/render_view_host.h" |
| 93 #include "content/public/browser/render_widget_host_view.h" | 93 #include "content/public/browser/render_widget_host_view.h" |
| 94 #include "content/public/browser/web_contents.h" | 94 #include "content/public/browser/web_contents.h" |
| 95 #import "ui/base/cocoa/cocoa_base_utils.h" | 95 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 96 #import "ui/base/cocoa/nsview_additions.h" | 96 #import "ui/base/cocoa/nsview_additions.h" |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 | 1908 |
| 1909 // Handle the openLearnMoreAboutCrashLink: action from SadTabController when | 1909 // Handle the openLearnMoreAboutCrashLink: action from SadTabController when |
| 1910 // "Learn more" link in "Aw snap" page (i.e. crash page or sad tab) is | 1910 // "Learn more" link in "Aw snap" page (i.e. crash page or sad tab) is |
| 1911 // clicked. Decoupling the action from its target makes unit testing possible. | 1911 // clicked. Decoupling the action from its target makes unit testing possible. |
| 1912 - (void)openLearnMoreAboutCrashLink:(id)sender { | 1912 - (void)openLearnMoreAboutCrashLink:(id)sender { |
| 1913 if (SadTabController* sadTab = | 1913 if (SadTabController* sadTab = |
| 1914 base::mac::ObjCCast<SadTabController>(sender)) { | 1914 base::mac::ObjCCast<SadTabController>(sender)) { |
| 1915 WebContents* webContents = [sadTab webContents]; | 1915 WebContents* webContents = [sadTab webContents]; |
| 1916 if (webContents) { | 1916 if (webContents) { |
| 1917 OpenURLParams params( | 1917 OpenURLParams params( |
| 1918 GURL(chrome::kCrashReasonURL), Referrer(), CURRENT_TAB, | 1918 GURL(sad_tab::kCrashReasonURL), Referrer(), CURRENT_TAB, |
| 1919 ui::PAGE_TRANSITION_LINK, false); | 1919 ui::PAGE_TRANSITION_LINK, false); |
| 1920 webContents->OpenURL(params); | 1920 webContents->OpenURL(params); |
| 1921 } | 1921 } |
| 1922 } | 1922 } |
| 1923 } | 1923 } |
| 1924 | 1924 |
| 1925 // Delegate method called when window did move. (See below for why we don't use | 1925 // Delegate method called when window did move. (See below for why we don't use |
| 1926 // |-windowWillMove:|, which is called less frequently than |-windowDidMove| | 1926 // |-windowWillMove:|, which is called less frequently than |-windowDidMove| |
| 1927 // instead.) | 1927 // instead.) |
| 1928 - (void)windowDidMove:(NSNotification*)notification { | 1928 - (void)windowDidMove:(NSNotification*)notification { |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 | 2229 |
| 2230 - (BOOL)supportsBookmarkBar { | 2230 - (BOOL)supportsBookmarkBar { |
| 2231 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2231 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2232 } | 2232 } |
| 2233 | 2233 |
| 2234 - (BOOL)isTabbedWindow { | 2234 - (BOOL)isTabbedWindow { |
| 2235 return browser_->is_type_tabbed(); | 2235 return browser_->is_type_tabbed(); |
| 2236 } | 2236 } |
| 2237 | 2237 |
| 2238 @end // @implementation BrowserWindowController(WindowType) | 2238 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |