OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
8 | 8 |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 break; | 1876 break; |
1877 default: | 1877 default: |
1878 NOTREACHED() << "Called with invalid mode=" << viewMode_; | 1878 NOTREACHED() << "Called with invalid mode=" << viewMode_; |
1879 break; | 1879 break; |
1880 } | 1880 } |
1881 | 1881 |
1882 webContents_.reset(content::WebContents::Create( | 1882 webContents_.reset(content::WebContents::Create( |
1883 content::WebContents::CreateParams(browser_->profile()))); | 1883 content::WebContents::CreateParams(browser_->profile()))); |
1884 webContents_->GetController().LoadURL(url, | 1884 webContents_->GetController().LoadURL(url, |
1885 content::Referrer(), | 1885 content::Referrer(), |
1886 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 1886 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
1887 std::string()); | 1887 std::string()); |
1888 NSView* webview = webContents_->GetNativeView(); | 1888 NSView* webview = webContents_->GetNativeView(); |
1889 [webview setFrameSize:NSMakeSize(kFixedGaiaViewWidth, kFixedGaiaViewHeight)]; | 1889 [webview setFrameSize:NSMakeSize(kFixedGaiaViewWidth, kFixedGaiaViewHeight)]; |
1890 [container addSubview:webview]; | 1890 [container addSubview:webview]; |
1891 yOffset = NSMaxY([webview frame]); | 1891 yOffset = NSMaxY([webview frame]); |
1892 | 1892 |
1893 // Adds the title card. | 1893 // Adds the title card. |
1894 NSBox* separator = [self horizontalSeparatorWithFrame: | 1894 NSBox* separator = [self horizontalSeparatorWithFrame: |
1895 NSMakeRect(0, yOffset, kFixedGaiaViewWidth, 0)]; | 1895 NSMakeRect(0, yOffset, kFixedGaiaViewWidth, 0)]; |
1896 [container addSubview:separator]; | 1896 [container addSubview:separator]; |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 } | 2177 } |
2178 | 2178 |
2179 - (bool)shouldShowGoIncognito { | 2179 - (bool)shouldShowGoIncognito { |
2180 bool incognitoAvailable = | 2180 bool incognitoAvailable = |
2181 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2181 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2182 IncognitoModePrefs::DISABLED; | 2182 IncognitoModePrefs::DISABLED; |
2183 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2183 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2184 } | 2184 } |
2185 | 2185 |
2186 @end | 2186 @end |
OLD | NEW |