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 #import "chrome/browser/ui/cocoa/first_run_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/first_run_bubble_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/first_run/first_run.h" | 9 #include "chrome/browser/first_run/first_run.h" |
10 #include "chrome/browser/search_engines/util.h" | 10 #include "chrome/browser/search_engines/util.h" |
11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_finder.h" |
12 #import "chrome/browser/ui/cocoa/l10n_util.h" | 12 #import "chrome/browser/ui/cocoa/l10n_util.h" |
13 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 13 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
16 | 16 |
17 @interface FirstRunBubbleController(Private) | 17 @interface FirstRunBubbleController(Private) |
18 - (id)initRelativeToView:(NSView*)view | 18 - (id)initRelativeToView:(NSView*)view |
19 offset:(NSPoint)offset | 19 offset:(NSPoint)offset |
20 profile:(Profile*)profile; | 20 profile:(Profile*)profile; |
21 - (void)closeIfNotKey; | 21 - (void)closeIfNotKey; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 - (void)closeIfNotKey { | 81 - (void)closeIfNotKey { |
82 if (![[self window] isKeyWindow]) | 82 if (![[self window] isKeyWindow]) |
83 [self close]; | 83 [self close]; |
84 } | 84 } |
85 | 85 |
86 - (IBAction)onChange:(id)sender { | 86 - (IBAction)onChange:(id)sender { |
87 first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_CHANGE_INVOKED); | 87 first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_CHANGE_INVOKED); |
88 | 88 |
89 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 89 Browser* browser = browser::FindLastActiveWithProfile(profile_); |
90 [self close]; | 90 [self close]; |
91 if (browser) | 91 if (browser) |
92 browser->OpenSearchEngineOptionsDialog(); | 92 browser->OpenSearchEngineOptionsDialog(); |
93 } | 93 } |
94 | 94 |
95 @end // FirstRunBubbleController | 95 @end // FirstRunBubbleController |
OLD | NEW |