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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.mm

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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/infobars/media_stream_infobar_controller.h" 5 #import "chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <string> 8 #include <string>
9 9
10 #import "base/sys_string_conversions.h" 10 #import "base/sys_string_conversions.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/infobars/infobar_tab_helper.h"
12 #include "chrome/browser/media/media_stream_devices_menu_model.h" 13 #include "chrome/browser/media/media_stream_devices_menu_model.h"
13 #include "chrome/browser/ui/cocoa/hover_close_button.h" 14 #include "chrome/browser/ui/cocoa/hover_close_button.h"
14 #include "chrome/browser/ui/cocoa/infobars/infobar.h" 15 #include "chrome/browser/ui/cocoa/infobars/infobar.h"
15 #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h" 16 #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h"
16 #include "chrome/browser/ui/media_stream_infobar_delegate.h" 17 #include "chrome/browser/ui/media_stream_infobar_delegate.h"
17 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
18 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 19 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
19 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
20 21
21 using InfoBarUtilities::CreateLabel; 22 using InfoBarUtilities::CreateLabel;
22 using InfoBarUtilities::MoveControl; 23 using InfoBarUtilities::MoveControl;
23 using InfoBarUtilities::VerifyControlOrderAndSpacing; 24 using InfoBarUtilities::VerifyControlOrderAndSpacing;
24 using l10n_util::GetNSStringWithFixup; 25 using l10n_util::GetNSStringWithFixup;
25 26
26 InfoBar* MediaStreamInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { 27 InfoBar* MediaStreamInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) {
28 InfoBarTabHelper* helper = (InfoBarTabHelper*)owner;
27 MediaStreamInfoBarController* infobar_controller = 29 MediaStreamInfoBarController* infobar_controller =
erikwright (departed) 2012/08/20 05:54:46 Again, perhaps converting MediaStreamInfoBarContro
Jói 2012/08/20 12:30:15 Done.
28 [[MediaStreamInfoBarController alloc] initWithDelegate:this 30 [[MediaStreamInfoBarController alloc] initWithDelegate:this
29 owner:owner]; 31 owner:helper];
30 return new InfoBar(infobar_controller, this); 32 return new InfoBar(infobar_controller, this);
31 } 33 }
32 34
33 35
34 @interface MediaStreamInfoBarController(Private) 36 @interface MediaStreamInfoBarController(Private)
35 37
36 // Adds text for all buttons and text fields. 38 // Adds text for all buttons and text fields.
37 - (void)setLabelTexts; 39 - (void)setLabelTexts;
38 40
39 // Populates the device menu with device id:s. 41 // Populates the device menu with device id:s.
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 [[[deviceMenu_ menu] itemAtIndex:0] setTitle:@""]; 261 [[[deviceMenu_ menu] itemAtIndex:0] setTitle:@""];
260 [[deviceMenu_ cell] setArrowPosition:NSPopUpArrowAtCenter]; 262 [[deviceMenu_ cell] setArrowPosition:NSPopUpArrowAtCenter];
261 } 263 }
262 } 264 }
263 265
264 - (void)didChangeFrame:(NSNotification*)notification { 266 - (void)didChangeFrame:(NSNotification*)notification {
265 [self arrangeInfobarLayout]; 267 [self arrangeInfobarLayout];
266 } 268 }
267 269
268 @end // implementation MediaStreamInfoBarController 270 @end // implementation MediaStreamInfoBarController
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698