OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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/clear_browsing_data_controller.h" | 5 #import "chrome/browser/ui/cocoa/clear_browsing_data_controller.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
11 #include "chrome/browser/browsing_data_remover.h" | 11 #include "chrome/browser/browsing_data_remover.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 #include "grit/locale_settings.h" | 17 #include "grit/locale_settings.h" |
18 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 18 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
19 | 19 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 [[self alloc] initWithProfile:profile]; | 91 [[self alloc] initWithProfile:profile]; |
92 it = map->insert(std::make_pair(profile, controller)).first; | 92 it = map->insert(std::make_pair(profile, controller)).first; |
93 } | 93 } |
94 return it->second; | 94 return it->second; |
95 } | 95 } |
96 | 96 |
97 - (id)initWithProfile:(Profile*)profile { | 97 - (id)initWithProfile:(Profile*)profile { |
98 DCHECK(profile); | 98 DCHECK(profile); |
99 // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we | 99 // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we |
100 // can override it in a unit test. | 100 // can override it in a unit test. |
101 NSString *nibpath = [mac_util::MainAppBundle() | 101 NSString *nibpath = [base::mac::MainAppBundle() |
102 pathForResource:@"ClearBrowsingData" | 102 pathForResource:@"ClearBrowsingData" |
103 ofType:@"nib"]; | 103 ofType:@"nib"]; |
104 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 104 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
105 profile_ = profile; | 105 profile_ = profile; |
106 observer_.reset(new ClearBrowsingObserver(self)); | 106 observer_.reset(new ClearBrowsingObserver(self)); |
107 [self initFromPrefs]; | 107 [self initFromPrefs]; |
108 } | 108 } |
109 return self; | 109 return self; |
110 } | 110 } |
111 | 111 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 object:self | 258 object:self |
259 userInfo:userInfo]; | 259 userInfo:userInfo]; |
260 | 260 |
261 [self closeDialog]; | 261 [self closeDialog]; |
262 [[self window] orderOut:self]; | 262 [[self window] orderOut:self]; |
263 [self setIsClearing:NO]; | 263 [self setIsClearing:NO]; |
264 remover_ = NULL; | 264 remover_ = NULL; |
265 } | 265 } |
266 | 266 |
267 @end | 267 @end |
OLD | NEW |