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

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 7396025: Refactor Instant web UI (chrome://settings page). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed estade's comments Created 9 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 int64 enable_time = service->GetInt64(prefs::kInstantEnabledTime); 129 int64 enable_time = service->GetInt64(prefs::kInstantEnabledTime);
130 if (enable_time) { 130 if (enable_time) {
131 base::TimeDelta delta = 131 base::TimeDelta delta =
132 base::Time::Now() - base::Time::FromInternalValue(enable_time); 132 base::Time::Now() - base::Time::FromInternalValue(enable_time);
133 // Histogram from 1 minute to 10 days. 133 // Histogram from 1 minute to 10 days.
134 UMA_HISTOGRAM_CUSTOM_COUNTS("Instant.TimeToDisable.Predictive", 134 UMA_HISTOGRAM_CUSTOM_COUNTS("Instant.TimeToDisable.Predictive",
135 delta.InMinutes(), 1, 60 * 24 * 10, 50); 135 delta.InMinutes(), 1, 60 * 24 * 10, 50);
136 } 136 }
137 137
138 service->SetBoolean(prefs::kInstantEnabledOnce, true);
138 service->SetBoolean(prefs::kInstantEnabled, false); 139 service->SetBoolean(prefs::kInstantEnabled, false);
139 } 140 }
140 141
141 // static 142 // static
142 bool InstantController::CommitIfCurrent(InstantController* controller) { 143 bool InstantController::CommitIfCurrent(InstantController* controller) {
143 if (controller && controller->IsCurrent()) { 144 if (controller && controller->IsCurrent()) {
144 controller->CommitCurrentPreview(INSTANT_COMMIT_PRESSED_ENTER); 145 controller->CommitCurrentPreview(INSTANT_COMMIT_PRESSED_ENTER);
145 return true; 146 return true;
146 } 147 }
147 return false; 148 return false;
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 if (destroy_factory_.empty()) { 733 if (destroy_factory_.empty()) {
733 MessageLoop::current()->PostTask( 734 MessageLoop::current()->PostTask(
734 FROM_HERE, destroy_factory_.NewRunnableMethod( 735 FROM_HERE, destroy_factory_.NewRunnableMethod(
735 &InstantController::DestroyLoaders)); 736 &InstantController::DestroyLoaders));
736 } 737 }
737 } 738 }
738 739
739 void InstantController::DestroyLoaders() { 740 void InstantController::DestroyLoaders() {
740 loaders_to_destroy_.reset(); 741 loaders_to_destroy_.reset();
741 } 742 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698