| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 74 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 75 #include "chrome/browser/ui/location_bar/location_bar.h" | 75 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 76 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 76 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 77 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 77 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 78 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" | 78 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" |
| 79 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" | 79 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" |
| 80 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 80 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 81 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 81 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 82 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
| 83 #include "chrome/common/extensions/command.h" | 83 #include "chrome/common/extensions/command.h" |
| 84 #include "chrome/common/url_constants.h" | |
| 85 #include "chrome/grit/generated_resources.h" | 84 #include "chrome/grit/generated_resources.h" |
| 86 #include "chrome/grit/locale_settings.h" | 85 #include "chrome/grit/locale_settings.h" |
| 87 #include "components/bookmarks/browser/bookmark_model.h" | 86 #include "components/bookmarks/browser/bookmark_model.h" |
| 87 #include "components/sad_tab/url_constants.h" |
| 88 #include "components/signin/core/common/profile_management_switches.h" | 88 #include "components/signin/core/common/profile_management_switches.h" |
| 89 #include "components/translate/core/browser/translate_manager.h" | 89 #include "components/translate/core/browser/translate_manager.h" |
| 90 #include "components/translate/core/browser/translate_ui_delegate.h" | 90 #include "components/translate/core/browser/translate_ui_delegate.h" |
| 91 #include "components/web_modal/popup_manager.h" | 91 #include "components/web_modal/popup_manager.h" |
| 92 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 92 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 93 #include "content/public/browser/render_view_host.h" | 93 #include "content/public/browser/render_view_host.h" |
| 94 #include "content/public/browser/render_widget_host_view.h" | 94 #include "content/public/browser/render_widget_host_view.h" |
| 95 #include "content/public/browser/web_contents.h" | 95 #include "content/public/browser/web_contents.h" |
| 96 #import "ui/base/cocoa/cocoa_base_utils.h" | 96 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 97 #include "ui/base/l10n/l10n_util.h" | 97 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1810 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 |