| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // by invoking |CommitCurrentPreview|, which results in |CommitInstant| | 44 // by invoking |CommitCurrentPreview|, which results in |CommitInstant| |
| 45 // being invoked on the delegate. | 45 // being invoked on the delegate. |
| 46 class InstantController : public InstantLoaderDelegate { | 46 class InstantController : public InstantLoaderDelegate { |
| 47 public: | 47 public: |
| 48 // Amount of time to wait before starting the instant animation. | 48 // Amount of time to wait before starting the instant animation. |
| 49 static const int kAutoCommitPauseTimeMS = 1000; | 49 static const int kAutoCommitPauseTimeMS = 1000; |
| 50 // Duration of the instant animation in which the colors change. | 50 // Duration of the instant animation in which the colors change. |
| 51 static const int kAutoCommitFadeInTimeMS = 300; | 51 static const int kAutoCommitFadeInTimeMS = 300; |
| 52 | 52 |
| 53 InstantController(Profile* profile, InstantDelegate* delegate); | 53 InstantController(Profile* profile, InstantDelegate* delegate); |
| 54 ~InstantController(); | 54 virtual ~InstantController(); |
| 55 | 55 |
| 56 // Registers instant related preferences. | 56 // Registers instant related preferences. |
| 57 static void RegisterUserPrefs(PrefService* prefs); | 57 static void RegisterUserPrefs(PrefService* prefs); |
| 58 | 58 |
| 59 // Records instant metrics. | 59 // Records instant metrics. |
| 60 static void RecordMetrics(Profile* profile); | 60 static void RecordMetrics(Profile* profile); |
| 61 | 61 |
| 62 // Returns true if instant is enabled. | 62 // Returns true if instant is enabled. |
| 63 static bool IsEnabled(Profile* profile); | 63 static bool IsEnabled(Profile* profile); |
| 64 | 64 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 ScopedVector<InstantLoader> loaders_to_destroy_; | 296 ScopedVector<InstantLoader> loaders_to_destroy_; |
| 297 | 297 |
| 298 // The set of hosts that we don't use instant with. This is shared across all | 298 // The set of hosts that we don't use instant with. This is shared across all |
| 299 // instances and only maintained for the current session. | 299 // instances and only maintained for the current session. |
| 300 static HostBlacklist* host_blacklist_; | 300 static HostBlacklist* host_blacklist_; |
| 301 | 301 |
| 302 DISALLOW_COPY_AND_ASSIGN(InstantController); | 302 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 303 }; | 303 }; |
| 304 | 304 |
| 305 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 305 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |