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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 1432143002: Track where WebContents are created in order to better understand issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 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 "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
6 6
7 #import <Carbon/Carbon.h> // kVK_Return. 7 #import <Carbon/Carbon.h> // kVK_Return.
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "chrome/common/url_constants.h" 48 #include "chrome/common/url_constants.h"
49 #include "chrome/grit/chromium_strings.h" 49 #include "chrome/grit/chromium_strings.h"
50 #include "chrome/grit/generated_resources.h" 50 #include "chrome/grit/generated_resources.h"
51 #include "components/signin/core/browser/profile_oauth2_token_service.h" 51 #include "components/signin/core/browser/profile_oauth2_token_service.h"
52 #include "components/signin/core/browser/signin_manager.h" 52 #include "components/signin/core/browser/signin_manager.h"
53 #include "components/signin/core/common/profile_management_switches.h" 53 #include "components/signin/core/common/profile_management_switches.h"
54 #include "content/public/browser/native_web_keyboard_event.h" 54 #include "content/public/browser/native_web_keyboard_event.h"
55 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
56 #include "content/public/browser/render_widget_host_view.h" 56 #include "content/public/browser/render_widget_host_view.h"
57 #include "content/public/browser/web_contents.h" 57 #include "content/public/browser/web_contents.h"
58 #include "content/public/browser/web_contents_source.h"
58 #include "google_apis/gaia/oauth2_token_service.h" 59 #include "google_apis/gaia/oauth2_token_service.h"
59 #include "grit/theme_resources.h" 60 #include "grit/theme_resources.h"
60 #include "skia/ext/skia_utils_mac.h" 61 #include "skia/ext/skia_utils_mac.h"
61 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw eaker.h" 62 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw eaker.h"
62 #import "ui/base/cocoa/cocoa_base_utils.h" 63 #import "ui/base/cocoa/cocoa_base_utils.h"
63 #import "ui/base/cocoa/controls/blue_label_button.h" 64 #import "ui/base/cocoa/controls/blue_label_button.h"
64 #import "ui/base/cocoa/controls/hyperlink_button_cell.h" 65 #import "ui/base/cocoa/controls/hyperlink_button_cell.h"
65 #import "ui/base/cocoa/controls/hyperlink_text_view.h" 66 #import "ui/base/cocoa/controls/hyperlink_text_view.h"
66 #import "ui/base/cocoa/hover_image_button.h" 67 #import "ui/base/cocoa/hover_image_button.h"
67 #include "ui/base/cocoa/window_size_constants.h" 68 #include "ui/base/cocoa/window_size_constants.h"
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 browser_->profile(), GetAuthErrorAccountId(browser_->profile())); 2096 browser_->profile(), GetAuthErrorAccountId(browser_->profile()));
2096 messageId = IDS_PROFILES_GAIA_REAUTH_TITLE; 2097 messageId = IDS_PROFILES_GAIA_REAUTH_TITLE;
2097 break; 2098 break;
2098 default: 2099 default:
2099 NOTREACHED() << "Called with invalid mode=" << viewMode_; 2100 NOTREACHED() << "Called with invalid mode=" << viewMode_;
2100 break; 2101 break;
2101 } 2102 }
2102 2103
2103 webContents_.reset(content::WebContents::Create( 2104 webContents_.reset(content::WebContents::Create(
2104 content::WebContents::CreateParams(browser_->profile()))); 2105 content::WebContents::CreateParams(browser_->profile())));
2106 WebContentsSource::CreateForWebContentsAndLocation(webContents_.get(),
2107 FROM_HERE);
2105 2108
2106 webContentsDelegate_.reset(new GaiaWebContentsDelegate()); 2109 webContentsDelegate_.reset(new GaiaWebContentsDelegate());
2107 webContents_->SetDelegate(webContentsDelegate_.get()); 2110 webContents_->SetDelegate(webContentsDelegate_.get());
2108 webContents_->GetController().LoadURL(url, 2111 webContents_->GetController().LoadURL(url,
2109 content::Referrer(), 2112 content::Referrer(),
2110 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, 2113 ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
2111 std::string()); 2114 std::string());
2112 NSView* webview = webContents_->GetNativeView(); 2115 NSView* webview = webContents_->GetNativeView();
2113 [webview setFrameSize:NSMakeSize(kFixedGaiaViewWidth, kFixedGaiaViewHeight)]; 2116 [webview setFrameSize:NSMakeSize(kFixedGaiaViewWidth, kFixedGaiaViewHeight)];
2114 [container addSubview:webview]; 2117 [container addSubview:webview];
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2404 } 2407 }
2405 2408
2406 - (bool)shouldShowGoIncognito { 2409 - (bool)shouldShowGoIncognito {
2407 bool incognitoAvailable = 2410 bool incognitoAvailable =
2408 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2411 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2409 IncognitoModePrefs::DISABLED; 2412 IncognitoModePrefs::DISABLED;
2410 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 2413 return incognitoAvailable && !browser_->profile()->IsGuestSession();
2411 } 2414 }
2412 2415
2413 @end 2416 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698