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

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

Issue 543663002: Componentize sad_tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 73 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
74 #include "chrome/browser/ui/location_bar/location_bar.h" 74 #include "chrome/browser/ui/location_bar/location_bar.h"
75 #include "chrome/browser/ui/tabs/tab_strip_model.h" 75 #include "chrome/browser/ui/tabs/tab_strip_model.h"
76 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" 76 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
77 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" 77 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
78 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" 78 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h"
79 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 79 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
80 #include "chrome/browser/ui/window_sizer/window_sizer.h" 80 #include "chrome/browser/ui/window_sizer/window_sizer.h"
81 #include "chrome/common/chrome_switches.h" 81 #include "chrome/common/chrome_switches.h"
82 #include "chrome/common/extensions/command.h" 82 #include "chrome/common/extensions/command.h"
83 #include "chrome/common/url_constants.h"
84 #include "chrome/grit/generated_resources.h" 83 #include "chrome/grit/generated_resources.h"
85 #include "chrome/grit/locale_settings.h" 84 #include "chrome/grit/locale_settings.h"
86 #include "components/bookmarks/browser/bookmark_model.h" 85 #include "components/bookmarks/browser/bookmark_model.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 #include "ui/base/l10n/l10n_util.h" 96 #include "ui/base/l10n/l10n_util.h"
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 1884
1885 // Handle the openLearnMoreAboutCrashLink: action from SadTabController when 1885 // Handle the openLearnMoreAboutCrashLink: action from SadTabController when
1886 // "Learn more" link in "Aw snap" page (i.e. crash page or sad tab) is 1886 // "Learn more" link in "Aw snap" page (i.e. crash page or sad tab) is
1887 // clicked. Decoupling the action from its target makes unit testing possible. 1887 // clicked. Decoupling the action from its target makes unit testing possible.
1888 - (void)openLearnMoreAboutCrashLink:(id)sender { 1888 - (void)openLearnMoreAboutCrashLink:(id)sender {
1889 if (SadTabController* sadTab = 1889 if (SadTabController* sadTab =
1890 base::mac::ObjCCast<SadTabController>(sender)) { 1890 base::mac::ObjCCast<SadTabController>(sender)) {
1891 WebContents* webContents = [sadTab webContents]; 1891 WebContents* webContents = [sadTab webContents];
1892 if (webContents) { 1892 if (webContents) {
1893 OpenURLParams params( 1893 OpenURLParams params(
1894 GURL(chrome::kCrashReasonURL), Referrer(), CURRENT_TAB, 1894 GURL(sad_tab::kCrashReasonURL), Referrer(), CURRENT_TAB,
1895 content::PAGE_TRANSITION_LINK, false); 1895 content::PAGE_TRANSITION_LINK, false);
1896 webContents->OpenURL(params); 1896 webContents->OpenURL(params);
1897 } 1897 }
1898 } 1898 }
1899 } 1899 }
1900 1900
1901 // Delegate method called when window did move. (See below for why we don't use 1901 // Delegate method called when window did move. (See below for why we don't use
1902 // |-windowWillMove:|, which is called less frequently than |-windowDidMove| 1902 // |-windowWillMove:|, which is called less frequently than |-windowDidMove|
1903 // instead.) 1903 // instead.)
1904 - (void)windowDidMove:(NSNotification*)notification { 1904 - (void)windowDidMove:(NSNotification*)notification {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 2198
2199 - (BOOL)supportsBookmarkBar { 2199 - (BOOL)supportsBookmarkBar {
2200 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2200 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2201 } 2201 }
2202 2202
2203 - (BOOL)isTabbedWindow { 2203 - (BOOL)isTabbedWindow {
2204 return browser_->is_type_tabbed(); 2204 return browser_->is_type_tabbed();
2205 } 2205 }
2206 2206
2207 @end // @implementation BrowserWindowController(WindowType) 2207 @end // @implementation BrowserWindowController(WindowType)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698