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 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 weak_factory_(this), | 338 weak_factory_(this), |
339 content_setting_bubble_model_delegate_( | 339 content_setting_bubble_model_delegate_( |
340 new BrowserContentSettingBubbleModelDelegate(this)), | 340 new BrowserContentSettingBubbleModelDelegate(this)), |
341 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), | 341 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), |
342 tab_restore_service_delegate_(new BrowserTabRestoreServiceDelegate(this)), | 342 tab_restore_service_delegate_(new BrowserTabRestoreServiceDelegate(this)), |
343 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), | 343 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), |
344 bookmark_bar_state_(BookmarkBar::HIDDEN), | 344 bookmark_bar_state_(BookmarkBar::HIDDEN), |
345 command_controller_(new chrome::BrowserCommandController( | 345 command_controller_(new chrome::BrowserCommandController( |
346 this, g_browser_process->profile_manager())), | 346 this, g_browser_process->profile_manager())), |
347 window_has_shown_(false) { | 347 window_has_shown_(false) { |
| 348 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); |
| 349 |
348 if (!app_name_.empty()) | 350 if (!app_name_.empty()) |
349 chrome::RegisterAppPrefs(app_name_, profile_); | 351 chrome::RegisterAppPrefs(app_name_, profile_); |
350 tab_strip_model_->AddObserver(this); | 352 tab_strip_model_->AddObserver(this); |
351 | 353 |
352 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); | 354 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); |
353 search_model_.reset(new SearchModel()); | 355 search_model_.reset(new SearchModel()); |
354 search_delegate_.reset( | 356 search_delegate_.reset( |
355 new SearchDelegate(search_model_.get(), toolbar_model_.get())); | 357 new SearchDelegate(search_model_.get(), toolbar_model_.get())); |
356 | 358 |
357 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 359 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2208 if (contents && !allow_js_access) { | 2210 if (contents && !allow_js_access) { |
2209 contents->web_contents()->GetController().LoadURL( | 2211 contents->web_contents()->GetController().LoadURL( |
2210 target_url, | 2212 target_url, |
2211 content::Referrer(), | 2213 content::Referrer(), |
2212 content::PAGE_TRANSITION_LINK, | 2214 content::PAGE_TRANSITION_LINK, |
2213 std::string()); // No extra headers. | 2215 std::string()); // No extra headers. |
2214 } | 2216 } |
2215 | 2217 |
2216 return contents != NULL; | 2218 return contents != NULL; |
2217 } | 2219 } |
OLD | NEW |