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

Side by Side Diff: chrome/browser/cocoa/content_blocked_bubble_controller.mm

Issue 1345005: Mac: Initial Geolocation UI. (Closed)
Patch Set: rebase Created 10 years, 9 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
« no previous file with comments | « chrome/app/nibs/ContentBubbleGeolocation.xib ('k') | chrome/chrome_browser.gypi » ('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) 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/cocoa/content_blocked_bubble_controller.h" 5 #import "chrome/browser/cocoa/content_blocked_bubble_controller.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac_util.h" 9 #include "base/mac_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // This method takes ownership of |contentSettingBubbleModel| in all cases. 87 // This method takes ownership of |contentSettingBubbleModel| in all cases.
88 scoped_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel); 88 scoped_ptr<ContentSettingBubbleModel> model(contentSettingBubbleModel);
89 DCHECK(model.get()); 89 DCHECK(model.get());
90 90
91 NSString* const nibPaths[CONTENT_SETTINGS_NUM_TYPES] = { 91 NSString* const nibPaths[CONTENT_SETTINGS_NUM_TYPES] = {
92 @"ContentBlockedCookies", 92 @"ContentBlockedCookies",
93 @"ContentBlockedImages", 93 @"ContentBlockedImages",
94 @"ContentBlockedJavaScript", 94 @"ContentBlockedJavaScript",
95 @"ContentBlockedPlugins", 95 @"ContentBlockedPlugins",
96 @"ContentBlockedPopups", 96 @"ContentBlockedPopups",
97 // TODO(joth/thakis): Implement Geolocation. In the meantime, use 97 @"ContentBubbleGeolocation",
98 // another xib here to keep the unit test happy.
99 @"ContentBlockedCookies",
100 }; 98 };
101 COMPILE_ASSERT(arraysize(nibPaths) == CONTENT_SETTINGS_NUM_TYPES, 99 COMPILE_ASSERT(arraysize(nibPaths) == CONTENT_SETTINGS_NUM_TYPES,
102 nibPaths_requires_an_entry_for_every_setting_type); 100 nibPaths_requires_an_entry_for_every_setting_type);
103 const int settingsType = model->content_type(); 101 const int settingsType = model->content_type();
104 DCHECK_LT(settingsType, CONTENT_SETTINGS_NUM_TYPES); 102 DCHECK_LT(settingsType, CONTENT_SETTINGS_NUM_TYPES);
105 NSString* nibPath = 103 NSString* nibPath =
106 [mac_util::MainAppBundle() pathForResource:nibPaths[settingsType] 104 [mac_util::MainAppBundle() pathForResource:nibPaths[settingsType]
107 ofType:@"nib"]; 105 ofType:@"nib"];
108 if ((self = [super initWithWindowNibPath:nibPath owner:self])) { 106 if ((self = [super initWithWindowNibPath:nibPath owner:self])) {
109 parentWindow_ = parentWindow; 107 parentWindow_ = parentWindow;
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 contentSettingBubbleModel_->OnManageLinkClicked(); 344 contentSettingBubbleModel_->OnManageLinkClicked();
347 } 345 }
348 346
349 - (void)popupLinkClicked:(id)sender { 347 - (void)popupLinkClicked:(id)sender {
350 content_blocked_bubble::PopupLinks::iterator i(popupLinks_.find(sender)); 348 content_blocked_bubble::PopupLinks::iterator i(popupLinks_.find(sender));
351 DCHECK(i != popupLinks_.end()); 349 DCHECK(i != popupLinks_.end());
352 contentSettingBubbleModel_->OnPopupClicked(i->second); 350 contentSettingBubbleModel_->OnPopupClicked(i->second);
353 } 351 }
354 352
355 @end // ContentBlockedBubbleController 353 @end // ContentBlockedBubbleController
OLDNEW
« no previous file with comments | « chrome/app/nibs/ContentBubbleGeolocation.xib ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698