| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/instant/instant_opt_in.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "chrome/browser/instant/instant_confirm_dialog.h" | |
| 9 #include "chrome/browser/profile.h" | |
| 10 #include "chrome/common/chrome_switches.h" | |
| 11 | |
| 12 namespace browser { | |
| 13 | |
| 14 static bool dialog_shown = false; | |
| 15 | |
| 16 bool ShouldShowInstantOptIn(Profile* profile) { | |
| 17 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowInstantOptIn)) | |
| 18 return false; | |
| 19 | |
| 20 // TODO(sky): implement me. | |
| 21 return !dialog_shown; | |
| 22 } | |
| 23 | |
| 24 void UserPickedInstantOptIn(gfx::NativeWindow parent, | |
| 25 Profile* profile, | |
| 26 bool opt_in) { | |
| 27 // TODO: set pref so don't show opt-in again. | |
| 28 dialog_shown = true; | |
| 29 if (opt_in) | |
| 30 browser::ShowInstantConfirmDialogIfNecessary(parent, profile); | |
| 31 } | |
| 32 | |
| 33 } // namespace browser | |
| OLD | NEW |