| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" | 124 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" |
| 125 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 125 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 126 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 126 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 127 #include "chrome/browser/ui/tabs/dock_info.h" | 127 #include "chrome/browser/ui/tabs/dock_info.h" |
| 128 #include "chrome/browser/ui/tabs/tab_finder.h" | 128 #include "chrome/browser/ui/tabs/tab_finder.h" |
| 129 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 129 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 130 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 130 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 131 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 131 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 132 #include "chrome/browser/ui/webui/feedback_ui.h" | 132 #include "chrome/browser/ui/webui/feedback_ui.h" |
| 133 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 133 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 134 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | |
| 135 #include "chrome/browser/ui/webui/options2/content_settings_handler2.h" | 134 #include "chrome/browser/ui/webui/options2/content_settings_handler2.h" |
| 136 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 135 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 137 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 136 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 138 #include "chrome/browser/ui/window_sizer.h" | 137 #include "chrome/browser/ui/window_sizer.h" |
| 139 #include "chrome/browser/upgrade_detector.h" | 138 #include "chrome/browser/upgrade_detector.h" |
| 140 #include "chrome/browser/web_applications/web_app.h" | 139 #include "chrome/browser/web_applications/web_app.h" |
| 141 #include "chrome/common/chrome_constants.h" | 140 #include "chrome/common/chrome_constants.h" |
| 142 #include "chrome/common/chrome_notification_types.h" | 141 #include "chrome/common/chrome_notification_types.h" |
| 143 #include "chrome/common/chrome_switches.h" | 142 #include "chrome/common/chrome_switches.h" |
| 144 #include "chrome/common/custom_handlers/protocol_handler.h" | 143 #include "chrome/common/custom_handlers/protocol_handler.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 if (local_state && local_state->FindPreference( | 557 if (local_state && local_state->FindPreference( |
| 559 prefs::kAutofillPersonalDataManagerFirstRun) && | 558 prefs::kAutofillPersonalDataManagerFirstRun) && |
| 560 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { | 559 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { |
| 561 // Notify PDM that this is a first run. | 560 // Notify PDM that this is a first run. |
| 562 #if defined(OS_WIN) | 561 #if defined(OS_WIN) |
| 563 ImportAutofillDataWin(PersonalDataManagerFactory::GetForProfile(profile_)); | 562 ImportAutofillDataWin(PersonalDataManagerFactory::GetForProfile(profile_)); |
| 564 #endif // defined(OS_WIN) | 563 #endif // defined(OS_WIN) |
| 565 // Reset the preference so we don't call it again for subsequent windows. | 564 // Reset the preference so we don't call it again for subsequent windows. |
| 566 local_state->ClearPref(prefs::kAutofillPersonalDataManagerFirstRun); | 565 local_state->ClearPref(prefs::kAutofillPersonalDataManagerFirstRun); |
| 567 } | 566 } |
| 568 | |
| 569 // Permanently dismiss ntp4 bubble for new users. | |
| 570 if (first_run::IsChromeFirstRun()) | |
| 571 NewTabPageHandler::DismissIntroMessage(local_state); | |
| 572 } | 567 } |
| 573 | 568 |
| 574 void Browser::SetWindowForTesting(BrowserWindow* window) { | 569 void Browser::SetWindowForTesting(BrowserWindow* window) { |
| 575 DCHECK(!window_); | 570 DCHECK(!window_); |
| 576 window_ = window; | 571 window_ = window; |
| 577 fullscreen_controller_ = new FullscreenController(window_, profile_, this); | 572 fullscreen_controller_ = new FullscreenController(window_, profile_, this); |
| 578 } | 573 } |
| 579 | 574 |
| 580 /////////////////////////////////////////////////////////////////////////////// | 575 /////////////////////////////////////////////////////////////////////////////// |
| 581 // Getters & Setters | 576 // Getters & Setters |
| (...skipping 4649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5231 if (contents && !allow_js_access) { | 5226 if (contents && !allow_js_access) { |
| 5232 contents->web_contents()->GetController().LoadURL( | 5227 contents->web_contents()->GetController().LoadURL( |
| 5233 target_url, | 5228 target_url, |
| 5234 content::Referrer(), | 5229 content::Referrer(), |
| 5235 content::PAGE_TRANSITION_LINK, | 5230 content::PAGE_TRANSITION_LINK, |
| 5236 std::string()); // No extra headers. | 5231 std::string()); // No extra headers. |
| 5237 } | 5232 } |
| 5238 | 5233 |
| 5239 return contents != NULL; | 5234 return contents != NULL; |
| 5240 } | 5235 } |
| OLD | NEW |