| 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_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 void Home(Browser* browser, WindowOpenDisposition disposition) { | 370 void Home(Browser* browser, WindowOpenDisposition disposition) { |
| 371 content::RecordAction(UserMetricsAction("Home")); | 371 content::RecordAction(UserMetricsAction("Home")); |
| 372 | 372 |
| 373 std::string extra_headers; | 373 std::string extra_headers; |
| 374 #if defined(ENABLE_RLZ) | 374 #if defined(ENABLE_RLZ) |
| 375 // If the home page is a Google home page, add the RLZ header to the request. | 375 // If the home page is a Google home page, add the RLZ header to the request. |
| 376 PrefService* pref_service = browser->profile()->GetPrefs(); | 376 PrefService* pref_service = browser->profile()->GetPrefs(); |
| 377 if (pref_service) { | 377 if (pref_service) { |
| 378 std::string home_page = pref_service->GetString(prefs::kHomePage); | 378 if (google_util::IsGoogleHomePageUrl( |
| 379 if (google_util::IsGoogleHomePageUrl(home_page)) { | 379 GURL(pref_service->GetString(prefs::kHomePage)))) { |
| 380 extra_headers = RLZTracker::GetAccessPointHttpHeader( | 380 extra_headers = RLZTracker::GetAccessPointHttpHeader( |
| 381 RLZTracker::CHROME_HOME_PAGE); | 381 RLZTracker::CHROME_HOME_PAGE); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 #endif | 384 #endif |
| 385 | 385 |
| 386 OpenURLParams params( | 386 OpenURLParams params( |
| 387 browser->profile()->GetHomePage(), Referrer(), disposition, | 387 browser->profile()->GetHomePage(), Referrer(), disposition, |
| 388 content::PageTransitionFromInt( | 388 content::PageTransitionFromInt( |
| 389 content::PAGE_TRANSITION_AUTO_BOOKMARK | | 389 content::PAGE_TRANSITION_AUTO_BOOKMARK | |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1103 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
| 1104 browser->host_desktop_type())); | 1104 browser->host_desktop_type())); |
| 1105 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1105 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1106 | 1106 |
| 1107 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1107 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1108 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1108 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1109 app_browser->window()->Show(); | 1109 app_browser->window()->Show(); |
| 1110 } | 1110 } |
| 1111 | 1111 |
| 1112 } // namespace chrome | 1112 } // namespace chrome |
| OLD | NEW |