diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 12:46:38 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 12:46:38 +0000 |
commit | f0a51fb571f46531025fa09240bbc3e1af925e84 (patch) | |
tree | 558b4f0e737fda4b9ab60f252c9c23b8a4ca523e /chrome/browser | |
parent | 6390be368205705f49ead3cec40396519f13b889 (diff) | |
download | chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.zip chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.gz chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.bz2 |
Fixes CRLF and trailing white spaces.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
125 files changed, 432 insertions, 432 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index d7b0a72..9bd9de2 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -40,12 +40,12 @@ // We can't use the standard terminate: method because it will abruptly exit // the app and leave things on the stack in an unfinalized state. We need to // post a quit message to our run loop so the stack can gracefully unwind. -- (IBAction)quit:(id)sender { +- (IBAction)quit:(id)sender { // TODO(pinkerton): // since we have to roll it ourselves, ask the delegate (ourselves, really) // if we should terminate. For example, we might not want to if the user // has ongoing downloads or multiple windows/tabs open. However, this would - // require posting UI and may require spinning up another run loop to + // require posting UI and may require spinning up another run loop to // handle it. If it says to continue, post the quit message, otherwise // go back to normal. @@ -57,7 +57,7 @@ // Close all the windows. BrowserList::CloseAllBrowsers(true); - + // Release the reference to the browser process. Once all the browsers get // dealloc'd, it will stop the RunLoop and fall back into main(). g_browser_process->ReleaseModule(); @@ -89,7 +89,7 @@ - (void)commandDispatch:(id)sender { // How to get the profile created on line 314 of browser_main? Ugh. TODO:FIXME Profile* default_profile = *g_browser_process->profile_manager()->begin(); - + NSInteger tag = [sender tag]; switch (tag) { case IDC_NEW_WINDOW: diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc index b420d75..0065f36 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.cc +++ b/chrome/browser/autocomplete/autocomplete_edit.cc @@ -148,7 +148,7 @@ bool AutocompleteEditModel::GetURLForText(const std::wstring& text, UserTextFromDisplayText(text), std::wstring(), &parts, NULL); if (type != AutocompleteInput::URL) return false; - + *url = GURL(URLFixerUpper::FixupURL(WideToUTF8(text), std::string())); return true; } @@ -346,12 +346,12 @@ bool AutocompleteEditModel::OnEscapeKeyPressed() { return true; } - // If the user wasn't editing, but merely had focus in the edit, allow <esc> - // to be processed as an accelerator, so it can still be used to stop a load. - // When the permanent text isn't all selected we still fall through to the - // SelectAll() call below so users can arrow around in the text and then hit + // If the user wasn't editing, but merely had focus in the edit, allow <esc> + // to be processed as an accelerator, so it can still be used to stop a load. + // When the permanent text isn't all selected we still fall through to the + // SelectAll() call below so users can arrow around in the text and then hit // <esc> to quickly replace all the text; this matches IE. - if (!user_input_in_progress_ && view_->IsSelectAll()) + if (!user_input_in_progress_ && view_->IsSelectAll()) return false; view_->RevertAll(); diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 307f502..6df7ff4 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -593,7 +593,7 @@ void AutocompleteEditViewWin::Update( CHARRANGE sel; GetSelection(sel); const bool was_reversed = (sel.cpMin > sel.cpMax); - const bool was_sel_all = (sel.cpMin != sel.cpMax) && + const bool was_sel_all = (sel.cpMin != sel.cpMax) && IsSelectAllForRange(sel); RevertAll(); diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 23d4407c..d462480 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -125,7 +125,7 @@ void SearchProvider::OnURLFetchComplete(const URLFetcher* source, // TODO(jungshik): Switch to CodePageToUTF8 after it's added. if (CodepageToWide(data, charset.c_str(), OnStringUtilConversionError::FAIL, &wide_data)) - json_data = WideToUTF8(wide_data); + json_data = WideToUTF8(wide_data); } } diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index dd39fc8..8d61d37 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -184,7 +184,7 @@ bool BookmarkCodec::DecodeNode(BookmarkModel* model, if (!DecodeChildren(model, *static_cast<ListValue*>(child_values), node)) return false; } - + node->SetTitle(title); node->date_added_ = Time::FromInternalValue( StringToInt64(WideToUTF16Hack(date_added_string))); diff --git a/chrome/browser/bookmarks/bookmark_context_menu.cc b/chrome/browser/bookmarks/bookmark_context_menu.cc index 2c58710..8c06b4e 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu.cc +++ b/chrome/browser/bookmarks/bookmark_context_menu.cc @@ -271,7 +271,7 @@ BookmarkContextMenu::BookmarkContextMenu( menu_->AppendMenuItemWithLabel( IDS_BOOKMARK_BAR_REMOVE, l10n_util::GetString(IDS_BOOKMARK_BAR_REMOVE)); - + if (configuration == BOOKMARK_MANAGER_TABLE || configuration == BOOKMARK_MANAGER_TABLE_OTHER || configuration == BOOKMARK_MANAGER_ORGANIZE_MENU || diff --git a/chrome/browser/bookmarks/bookmark_context_menu.h b/chrome/browser/bookmarks/bookmark_context_menu.h index 1d08110..460f01d 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu.h +++ b/chrome/browser/bookmarks/bookmark_context_menu.h @@ -22,7 +22,7 @@ class Browser; class PageNavigator; // BookmarkContextMenu manages the context menu shown for the -// bookmark bar, items on the bookmark bar, submenus of the bookmark bar and +// bookmark bar, items on the bookmark bar, submenus of the bookmark bar and // the bookmark manager. class BookmarkContextMenu : public views::MenuDelegate, public BookmarkModelObserver { diff --git a/chrome/browser/bookmarks/bookmark_drop_info.h b/chrome/browser/bookmarks/bookmark_drop_info.h index b7dc643..d5ed4de3 100644 --- a/chrome/browser/bookmarks/bookmark_drop_info.h +++ b/chrome/browser/bookmarks/bookmark_drop_info.h @@ -78,7 +78,7 @@ class BookmarkDropInfo { // Used when autoscrolling. base::RepeatingTimer<BookmarkDropInfo> scroll_timer_; - + DISALLOW_COPY_AND_ASSIGN(BookmarkDropInfo); }; diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc index 5ec7ca0..b3ed5af 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer.cc @@ -322,7 +322,7 @@ void WriteBookmarks(MessageLoop* thread, // for the duration of the write), as such we make a copy of the // BookmarkModel using BookmarkCodec then write from that. BookmarkCodec codec; - scoped_ptr<Writer> writer(new Writer(codec.Encode(model), + scoped_ptr<Writer> writer(new Writer(codec.Encode(model), FilePath::FromWStringHack(path))); if (thread) thread->PostTask(FROM_HERE, writer.release()); diff --git a/chrome/browser/bookmarks/bookmark_table_model.cc b/chrome/browser/bookmarks/bookmark_table_model.cc index 7a50e29..a88bb81 100644 --- a/chrome/browser/bookmarks/bookmark_table_model.cc +++ b/chrome/browser/bookmarks/bookmark_table_model.cc @@ -274,7 +274,7 @@ BookmarkTableModel* BookmarkTableModel::CreateBookmarkTableModelForFolder( BookmarkTableModel* BookmarkTableModel::CreateSearchTableModel( BookmarkModel* model, const std::wstring& text) { - return new BookmarkSearchTableModel(model, text); + return new BookmarkSearchTableModel(model, text); } BookmarkTableModel::BookmarkTableModel(BookmarkModel* model) diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 45e7c6d..18a6bc0 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -254,7 +254,7 @@ void OpenAll(gfx::NativeWindow parent, NewBrowserPageNavigator navigator_impl(profile); if (!navigator) { - Browser* browser = + Browser* browser = BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL); if (!browser || !browser->GetSelectedTabContents()) { navigator = &navigator_impl; diff --git a/chrome/browser/cocoa/base_view.mm b/chrome/browser/cocoa/base_view.mm index 9d8e247..9ea74fb 100644 --- a/chrome/browser/cocoa/base_view.mm +++ b/chrome/browser/cocoa/base_view.mm @@ -24,7 +24,7 @@ - (void)dealloc { [self removeTrackingArea:trackingArea_]; [trackingArea_ release]; - + [super dealloc]; } diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index 9d1ae21..0f611b3 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -7,7 +7,7 @@ #include "chrome/browser/cocoa/browser_window_cocoa.h" #include "chrome/browser/cocoa/browser_window_controller.h" -BrowserWindowCocoa::BrowserWindowCocoa(BrowserWindowController* controller, +BrowserWindowCocoa::BrowserWindowCocoa(BrowserWindowController* controller, NSWindow* window) : controller_(controller), window_(window) { } @@ -27,7 +27,7 @@ void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) { bounds.height()); // flip coordinates NSScreen* screen = [window_ screen]; - cocoa_bounds.origin.y = + cocoa_bounds.origin.y = [screen frame].size.height - bounds.height() - bounds.y(); } @@ -44,7 +44,7 @@ void BrowserWindowCocoa::Activate() { } void BrowserWindowCocoa::FlashFrame() { - [[NSApplication sharedApplication] + [[NSApplication sharedApplication] requestUserAttention:NSInformationalRequest]; } @@ -123,7 +123,7 @@ void BrowserWindowCocoa::UpdateStopGoState(bool is_loading) { void BrowserWindowCocoa::UpdateToolbar(TabContents* contents, bool should_restore_state) { - [controller_ updateToolbarWithContents:contents + [controller_ updateToolbarWithContents:contents shouldRestoreState:should_restore_state ? YES : NO]; } @@ -189,7 +189,7 @@ void BrowserWindowCocoa::ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, void* parent_window) { NOTIMPLEMENTED(); } - + void BrowserWindowCocoa::DestroyBrowser() { [controller_ destroyBrowser]; diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 3365812..8779fed 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -38,11 +38,11 @@ - (void)windowDidLoad { // Create a controller for the tab strip, giving it the model object for // this window's Browser and the tab strip view. The controller will handle - // registering for the appropriate tab notifications from the back-end and + // registering for the appropriate tab notifications from the back-end and // managing the creation of new tabs. - tabStripController_ = + tabStripController_ = [[TabStripController alloc] - initWithView:tabStripView_ + initWithView:tabStripView_ tabModel:browser_->tabstrip_model() toolbarModel:browser_->toolbar_model() commands:browser_->command_updater()]; @@ -67,7 +67,7 @@ // from this method. - (void)windowWillClose:(NSNotification *)notification { DCHECK(!browser_->tabstrip_model()->count()); - + // We can't acutally use |-autorelease| here because there's an embedded // run loop in the |-performClose:| which contains its own autorelease pool. // Instead we use call it after a zero-length delay, which gets us back @@ -150,7 +150,7 @@ // in the coordinate system of the content area of the currently selected tab. // |windowGrowBox| needs to be in the window's coordinate system. - (NSRect)selectedTabGrowBoxRect { - return [tabStripController_ + return [tabStripController_ selectedTabGrowBoxRect]; } @@ -161,7 +161,7 @@ // Called to start/stop the loading animations. - (void)updateLoadingAnimations:(BOOL)animate { if (animate) { - // TODO(pinkerton): determine what throbber animation is necessary and + // TODO(pinkerton): determine what throbber animation is necessary and // start a timer to periodically update. Windows tells the tab strip to // do this. It uses a single timer to coalesce the multiple things that // could be updating. http://crbug.com/8281 diff --git a/chrome/browser/cocoa/grow_box_view.m b/chrome/browser/cocoa/grow_box_view.m index 79f3ca0..d7ace41 100644 --- a/chrome/browser/cocoa/grow_box_view.m +++ b/chrome/browser/cocoa/grow_box_view.m @@ -17,7 +17,7 @@ // Draws the "grow_box" image in our bounds. - (void)drawRect:(NSRect)dirtyRect { - [image_ drawInRect:[self bounds] fromRect:NSZeroRect + [image_ drawInRect:[self bounds] fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } diff --git a/chrome/browser/cocoa/sad_tab_view.mm b/chrome/browser/cocoa/sad_tab_view.mm index eddb505..c74f297 100644 --- a/chrome/browser/cocoa/sad_tab_view.mm +++ b/chrome/browser/cocoa/sad_tab_view.mm @@ -20,17 +20,17 @@ static const int kTitleMessageSpacing = 15; base::SysWideToNSString(l10n_util::GetString(IDS_SAD_TAB_TITLE)); NSString* message = base::SysWideToNSString(l10n_util::GetString(IDS_SAD_TAB_MESSAGE)); - + NSColor* textColor = [NSColor whiteColor]; NSColor* backgroundColor = [NSColor colorWithCalibratedRed:(35.0f/255.0f) green:(48.0f/255.0f) blue:(64.0f/255.0f) alpha:1.0]; - + // Layout NSFont* titleFont = [NSFont boldSystemFontOfSize:[NSFont systemFontSize]]; NSFont* messageFont = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; - + NSDictionary* titleAttrs = [NSDictionary dictionaryWithObjectsAndKeys: titleFont, NSFontAttributeName, textColor, NSForegroundColorAttributeName, @@ -39,23 +39,23 @@ static const int kTitleMessageSpacing = 15; messageFont, NSFontAttributeName, textColor, NSForegroundColorAttributeName, nil]; - + NSAttributedString* titleString = [[[NSAttributedString alloc] initWithString:title attributes:titleAttrs] autorelease]; NSAttributedString* messageString = [[[NSAttributedString alloc] initWithString:message attributes:messageAttrs] autorelease]; - + NSRect viewBounds = [self bounds]; - + NSSize sadTabImageSize = [sadTabImage size]; CGFloat iconWidth = sadTabImageSize.width; CGFloat iconHeight = sadTabImageSize.height; CGFloat iconX = (viewBounds.size.width - iconWidth) / 2; CGFloat iconY = ((viewBounds.size.height - iconHeight) / 2) - kSadTabOffset; - + NSSize titleSize = [titleString size]; CGFloat titleX = (viewBounds.size.width - titleSize.width) / 2; CGFloat titleY = iconY - kIconTitleSpacing - titleSize.height; @@ -63,11 +63,11 @@ static const int kTitleMessageSpacing = 15; NSSize messageSize = [messageString size]; CGFloat messageX = (viewBounds.size.width - messageSize.width) / 2; CGFloat messageY = titleY - kTitleMessageSpacing - messageSize.height; - + // Paint [backgroundColor set]; NSRectFill(viewBounds); - + [sadTabImage drawAtPoint:NSMakePoint(iconX, iconY) fromRect:NSZeroRect operation:NSCompositeSourceOver diff --git a/chrome/browser/cocoa/tab_contents_controller.h b/chrome/browser/cocoa/tab_contents_controller.h index 2bf021a..bc97e4f 100644 --- a/chrome/browser/cocoa/tab_contents_controller.h +++ b/chrome/browser/cocoa/tab_contents_controller.h @@ -46,7 +46,7 @@ class ToolbarModel; // Create the contents of a tab represented by |contents| and loaded from the // nib given by |name|. |commands| allows tracking of what's enabled and // disabled. It may be nil if no updating is desired. -- (id)initWithNibName:(NSString*)name +- (id)initWithNibName:(NSString*)name bundle:(NSBundle*)bundle contents:(TabContents*)contents commands:(CommandUpdater*)commands diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm index 0700341..f20038e 100644 --- a/chrome/browser/cocoa/tab_contents_controller.mm +++ b/chrome/browser/cocoa/tab_contents_controller.mm @@ -58,7 +58,7 @@ class LocationBarBridge : public LocationBar { virtual std::wstring GetInputString() const; virtual WindowOpenDisposition GetWindowOpenDisposition() const { NOTIMPLEMENTED(); return CURRENT_TAB; } - virtual PageTransition::Type GetPageTransition() const + virtual PageTransition::Type GetPageTransition() const { NOTIMPLEMENTED(); return 0; } virtual void AcceptInput() { NOTIMPLEMENTED(); } virtual void FocusLocation(); @@ -71,7 +71,7 @@ class LocationBarBridge : public LocationBar { @implementation TabContentsController -- (id)initWithNibName:(NSString*)name +- (id)initWithNibName:(NSString*)name bundle:(NSBundle*)bundle contents:(TabContents*)contents commands:(CommandUpdater*)commands @@ -97,7 +97,7 @@ class LocationBarBridge : public LocationBar { - (void)awakeFromNib { [contentsBox_ setContentView:contents_->GetNativeView()]; - + // Provide a starting point since we won't get notifications if the state // doesn't change between tabs. [self updateToolbarCommandStatus]; @@ -185,7 +185,7 @@ class LocationBarBridge : public LocationBar { - (void)updateToolbarWithContents:(TabContents*)tab { // TODO(pinkerton): there's a lot of ui code in autocomplete_edit.cc // that we'll want to duplicate. For now, just handle setting the text. - + // TODO(pinkerton): update the security lock icon and background color NSString* urlString = base::SysWideToNSString(toolbarModel_->GetText()); @@ -217,8 +217,8 @@ class LocationBarBridge : public LocationBar { localGrowBox = [contentView convertRect:localGrowBox fromView:[self view]]; // Flip the rect in view coordinates - localGrowBox.origin.y = - [contentView frame].size.height - localGrowBox.origin.y - + localGrowBox.origin.y = + [contentView frame].size.height - localGrowBox.origin.y - localGrowBox.size.height; } return localGrowBox; @@ -252,9 +252,9 @@ TabContentsCommandObserver::~TabContentsCommandObserver() { commands_->RemoveCommandObserver(this); } -void TabContentsCommandObserver::EnabledStateChangedForCommand(int command, +void TabContentsCommandObserver::EnabledStateChangedForCommand(int command, bool enabled) { - [controller_ enabledStateChangedForCommand:command + [controller_ enabledStateChangedForCommand:command enabled:enabled ? YES : NO]; } diff --git a/chrome/browser/cocoa/tab_strip_controller.h b/chrome/browser/cocoa/tab_strip_controller.h index 8a41c08..bc1f8c0 100644 --- a/chrome/browser/cocoa/tab_strip_controller.h +++ b/chrome/browser/cocoa/tab_strip_controller.h @@ -44,7 +44,7 @@ class ToolbarModel; // Initialize the controller with a view, model, and command updater for // tracking what's enabled and disabled. |commands| may be nil if no updating // is desired. -- (id)initWithView:(TabStripView*)view +- (id)initWithView:(TabStripView*)view tabModel:(TabStripModel*)tabModel toolbarModel:(ToolbarModel*)toolbarModel commands:(CommandUpdater*)commands; diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 9f5e544..26717d1 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -20,13 +20,13 @@ const short kTabOverlap = 16; - (void)insertTabWithContents:(TabContents*)contents atIndex:(NSInteger)index inForeground:(bool)inForeground; -- (void)selectTabWithContents:(TabContents*)newContents +- (void)selectTabWithContents:(TabContents*)newContents previousContents:(TabContents*)oldContents atIndex:(NSInteger)index userGesture:(bool)wasUserGesture; - (void)tabDetachedWithContents:(TabContents*)contents atIndex:(NSInteger)index; -- (void)tabChangedWithContents:(TabContents*)contents +- (void)tabChangedWithContents:(TabContents*)contents atIndex:(NSInteger)index; @end @@ -60,7 +60,7 @@ class TabStripBridge : public TabStripModelObserver { @implementation TabStripController -- (id)initWithView:(TabStripView*)view +- (id)initWithView:(TabStripView*)view tabModel:(TabStripModel*)tabModel toolbarModel:(ToolbarModel*)toolbarModel commands:(CommandUpdater*)commands { @@ -72,7 +72,7 @@ class TabStripBridge : public TabStripModelObserver { commands_ = commands; bridge_ = new TabStripBridge(tabModel, self); tabControllerArray_ = [[NSMutableArray alloc] init]; - + // Create the new tab button separate from the nib so we can make sure // it's always at the end of the subview list. NSImage* image = [NSImage imageNamed:@"newtab"]; @@ -100,7 +100,7 @@ class TabStripBridge : public TabStripModelObserver { // out the sole child of the contentArea to display its contents. - (void)swapInTabAtIndex:(NSInteger)index { TabContentsController* controller = [tabControllerArray_ objectAtIndex:index]; - + // Resize the new view to fit the window NSView* contentView = [[tabView_ window] contentView]; NSView* newView = [controller view]; @@ -132,7 +132,7 @@ class TabStripBridge : public TabStripModelObserver { [button setBezelStyle:NSRegularSquareBezelStyle]; [button setTarget:self]; [button setAction:@selector(selectTab:)]; - + return button; } @@ -162,13 +162,13 @@ class TabStripBridge : public TabStripModelObserver { tabModel_->SelectTabContentsAt(index, true); } -// Return the frame for a new tab that will go to the immediate right of the +// Return the frame for a new tab that will go to the immediate right of the // tab at |index|. If |index| is 0, this will be the first tab, indented so // as to not cover the window controls. - (NSRect)frameForNewTabAtIndex:(NSInteger)index { const short kIndentLeavingSpaceForControls = 66; const short kNewTabWidth = 160; - + short xOffset = kIndentLeavingSpaceForControls; if (index > 0) { NSRect previousTab = [[[tabView_ subviews] objectAtIndex:index - 1] frame]; @@ -196,43 +196,43 @@ class TabStripBridge : public TabStripModelObserver { inForeground:(bool)inForeground { DCHECK(contents); DCHECK(index == TabStripModel::kNoTab || tabModel_->ContainsIndex(index)); - + // TODO(pinkerton): handle tab dragging in here // Make a new tab. Load the contents of this tab from the nib and associate // the new controller with |contents| so it can be looked up later. TabContentsController* contentsController = - [[[TabContentsController alloc] initWithNibName:@"TabContents" + [[[TabContentsController alloc] initWithNibName:@"TabContents" bundle:nil contents:contents commands:commands_ toolbarModel:toolbarModel_] autorelease]; [tabControllerArray_ insertObject:contentsController atIndex:index]; - + // Remove the new tab button so the only views present are the tabs, // we'll add it back when we're done [newTabButton_ removeFromSuperview]; - + // Make a new tab view and add it to the strip. // TODO(pinkerton): move everyone else over and animate. Also will need to // move the "add tab" button over. NSRect newTabFrame = [self frameForNewTabAtIndex:index]; NSButton* newView = [self newTabWithFrame:newTabFrame]; [tabView_ addSubview:newView]; - + [self setTabTitle:newView withContents:contents]; - + // Add the new tab button back in to the right of the last tab. const NSInteger kNewTabXOffset = 10; - NSRect lastTab = + NSRect lastTab = [[[tabView_ subviews] objectAtIndex:[[tabView_ subviews] count] - 1] frame]; NSInteger maxRightEdge = NSMaxX(lastTab); NSRect newTabButtonFrame = [newTabButton_ frame]; newTabButtonFrame.origin.x = maxRightEdge + kNewTabXOffset; [newTabButton_ setFrame:newTabButtonFrame]; [tabView_ addSubview:newTabButton_]; - + // Select the newly created tab if in the foreground if (inForeground) [self swapInTabAtIndex:index]; @@ -240,7 +240,7 @@ class TabStripBridge : public TabStripModelObserver { // Called when a notification is received from the model to select a particular // tab. Swaps in the toolbar and content area associated with |newContents|. -- (void)selectTabWithContents:(TabContents*)newContents +- (void)selectTabWithContents:(TabContents*)newContents previousContents:(TabContents*)oldContents atIndex:(NSInteger)index userGesture:(bool)wasUserGesture { @@ -250,7 +250,7 @@ class TabStripBridge : public TabStripModelObserver { NSButton* current = [[tabView_ subviews] objectAtIndex:i]; [current setState:(i == index) ? NSOnState : NSOffState]; } - + // Tell the new tab contents it is about to become the selected tab. Here it // can do things like make sure the toolbar is up to date. TabContentsController* newController = @@ -262,7 +262,7 @@ class TabStripBridge : public TabStripModelObserver { } // Called when a notification is received from the model that the given tab -// has gone away. Remove all knowledge about this tab and it's associated +// has gone away. Remove all knowledge about this tab and it's associated // controller and remove the view from the strip. - (void)tabDetachedWithContents:(TabContents*)contents atIndex:(NSInteger)index { @@ -276,7 +276,7 @@ class TabStripBridge : public TabStripModelObserver { NSView* tab = [[tabView_ subviews] objectAtIndex:index]; NSInteger tabWidth = [tab frame].size.width; [tab removeFromSuperview]; - + // Move all the views to the right the width of the tab that was closed. // TODO(pinkerton): Animate! const int numSubviews = [[tabView_ subviews] count]; @@ -290,11 +290,11 @@ class TabStripBridge : public TabStripModelObserver { // Called when a notification is received from the model that the given tab // has been updated. -- (void)tabChangedWithContents:(TabContents*)contents +- (void)tabChangedWithContents:(TabContents*)contents atIndex:(NSInteger)index { NSButton* tab = [[tabView_ subviews] objectAtIndex:index]; [self setTabTitle:tab withContents:contents]; - + TabContentsController* updatedController = [tabControllerArray_ objectAtIndex:index]; [updatedController tabDidChange:contents]; @@ -309,13 +309,13 @@ class TabStripBridge : public TabStripModelObserver { - (void)updateToolbarWithContents:(TabContents*)tab shouldRestoreState:(BOOL)shouldRestore { // TODO(pinkerton): OS_WIN maintains this, but I'm not sure why. It's - // available by querying the model, which we have available to us. + // available by querying the model, which we have available to us. currentTab_ = tab; - + // tell the appropriate controller to update its state. |shouldRestore| being // YES means we're going back to this tab and should put back any state // associated with it. - TabContentsController* controller = + TabContentsController* controller = [tabControllerArray_ objectAtIndex:tabModel_->GetIndexOfTabContents(tab)]; [controller updateToolbarWithContents:shouldRestore ? tab : nil]; } @@ -364,7 +364,7 @@ class TabStripBridge : public TabStripModelObserver { //-------------------------------------------------------------------------- -TabStripBridge::TabStripBridge(TabStripModel* model, +TabStripBridge::TabStripBridge(TabStripModel* model, TabStripController* controller) : controller_(controller), model_(model) { // Register to be a listener on the model so we can get updates and tell @@ -380,8 +380,8 @@ TabStripBridge::~TabStripBridge() { void TabStripBridge::TabInsertedAt(TabContents* contents, int index, bool foreground) { - [controller_ insertTabWithContents:contents - atIndex:index + [controller_ insertTabWithContents:contents + atIndex:index inForeground:foreground]; } @@ -393,7 +393,7 @@ void TabStripBridge::TabSelectedAt(TabContents* old_contents, TabContents* new_contents, int index, bool user_gesture) { - [controller_ selectTabWithContents:new_contents + [controller_ selectTabWithContents:new_contents previousContents:old_contents atIndex:index userGesture:user_gesture]; diff --git a/chrome/browser/command_updater.h b/chrome/browser/command_updater.h index cbc14fe..f0303fc 100644 --- a/chrome/browser/command_updater.h +++ b/chrome/browser/command_updater.h @@ -61,7 +61,7 @@ class CommandUpdater { // Removes an observer to the state of a particular command. void RemoveCommandObserver(int id, CommandObserver* observer); - + // Removes |observer| for all commands on which it's registered. void RemoveCommandObserver(CommandObserver* observer); diff --git a/chrome/browser/command_updater_unittest.cc b/chrome/browser/command_updater_unittest.cc index d090d3d..dc5e031 100644 --- a/chrome/browser/command_updater_unittest.cc +++ b/chrome/browser/command_updater_unittest.cc @@ -79,12 +79,12 @@ TEST_F(CommandUpdaterTest, TestObservers) { TEST_F(CommandUpdaterTest, TestObserverRemovingAllCommands) { TestingCommandHandlerMock handler; CommandUpdater command_updater(&handler); - + // Create two observers for the commands 1-3 as true, remove one using the // single remove command, then set the command to false. Ensure that the // removed observer still thinks all commands are true and the one left // observing picked up the change. - + TestingCommandObserverMock observer_remove, observer_keep; command_updater.AddCommandObserver(1, &observer_remove); command_updater.AddCommandObserver(2, &observer_remove); diff --git a/chrome/browser/debugger/debugger_contents.cc b/chrome/browser/debugger/debugger_contents.cc index 386b5d8..5927caa 100644 --- a/chrome/browser/debugger/debugger_contents.cc +++ b/chrome/browser/debugger/debugger_contents.cc @@ -137,7 +137,7 @@ void DebuggerContents::Init() { // static bool DebuggerContents::IsDebuggerUrl(const GURL& url) { - return (url.SchemeIs(DOMUIContents::GetScheme().c_str()) && + return (url.SchemeIs(DOMUIContents::GetScheme().c_str()) && url.host() == kDebuggerHost); } diff --git a/chrome/browser/debugger/debugger_host.h b/chrome/browser/debugger/debugger_host.h index bfb2efa..c008c30 100644 --- a/chrome/browser/debugger/debugger_host.h +++ b/chrome/browser/debugger/debugger_host.h @@ -27,7 +27,7 @@ class DebuggerHost : public base::RefCountedThreadSafe<DebuggerHost> { virtual void OnDebugAttach() = 0; // The renderer we're attached to is gone. virtual void OnDebugDisconnect() = 0; - + virtual void DidDisconnect() = 0; virtual void DidConnect() {} virtual void ProcessCommand(const std::wstring& data) {} diff --git a/chrome/browser/debugger/debugger_host_impl.cpp b/chrome/browser/debugger/debugger_host_impl.cpp index beeb398..83795d8 100644 --- a/chrome/browser/debugger/debugger_host_impl.cpp +++ b/chrome/browser/debugger/debugger_host_impl.cpp @@ -66,7 +66,7 @@ class TabContentsReference : public NotificationObserver { DebuggerHostImpl::DebuggerHostImpl(DebuggerInputOutput* io) - : io_(io), + : io_(io), debugger_ready_(true) { } @@ -75,8 +75,8 @@ DebuggerHostImpl::~DebuggerHostImpl() { io_ = NULL; } -void DebuggerHostImpl::Start() { - io_->Start(this); +void DebuggerHostImpl::Start() { + io_->Start(this); } void DebuggerHostImpl::Debug(TabContents* tab) { diff --git a/chrome/browser/debugger/debugger_io.h b/chrome/browser/debugger/debugger_io.h index b2ea381..68b04e6 100644 --- a/chrome/browser/debugger/debugger_io.h +++ b/chrome/browser/debugger/debugger_io.h @@ -42,7 +42,7 @@ public: virtual void SetDebuggerBreak(bool brk) {} // sends message to debugger UI page in order to invoke JS function in it - virtual void CallFunctionInPage(const std::wstring& name, + virtual void CallFunctionInPage(const std::wstring& name, ListValue* argv) {} protected: diff --git a/chrome/browser/debugger/debugger_window.cc b/chrome/browser/debugger/debugger_window.cc index 1f62d01..aae04e6 100644 --- a/chrome/browser/debugger/debugger_window.cc +++ b/chrome/browser/debugger/debugger_window.cc @@ -126,7 +126,7 @@ void DebuggerWindow::SetDebuggerBreak(bool brk) { #endif } -void DebuggerWindow::CallFunctionInPage(const std::wstring& name, +void DebuggerWindow::CallFunctionInPage(const std::wstring& name, ListValue* argv) { if (view_) { DictionaryValue* body = new DictionaryValue; diff --git a/chrome/browser/debugger/debugger_window.h b/chrome/browser/debugger/debugger_window.h index 4b980f3..85f4ff8 100644 --- a/chrome/browser/debugger/debugger_window.h +++ b/chrome/browser/debugger/debugger_window.h @@ -37,7 +37,7 @@ class DebuggerWindow : public DebuggerInputOutput, virtual void SetDebuggerBreak(bool brk); // Note that this method will take ownership of argv. - virtual void CallFunctionInPage(const std::wstring& name, + virtual void CallFunctionInPage(const std::wstring& name, ListValue* argv); // views::WindowDelegate methods: diff --git a/chrome/browser/dock_info.cc b/chrome/browser/dock_info.cc index e1c394c..ead6878 100644 --- a/chrome/browser/dock_info.cc +++ b/chrome/browser/dock_info.cc @@ -360,7 +360,7 @@ DockInfo DockInfo::GetDockInfoAtPoint(const gfx::Point& screen_point, int mid_x = (m_bounds.left + m_bounds.right) / 2; int mid_y = (m_bounds.top + m_bounds.bottom) / 2; - bool result = + bool result = info.CheckMonitorPoint(monitor, screen_point, mid_x, m_bounds.top, DockInfo::MAXIMIZE) || info.CheckMonitorPoint(monitor, screen_point, mid_x, m_bounds.bottom, diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.cc b/chrome/browser/dom_ui/chrome_url_data_manager.cc index 89cfe89..532c117 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.cc +++ b/chrome/browser/dom_ui/chrome_url_data_manager.cc @@ -105,7 +105,7 @@ void RegisterURLRequestChromeJob() { #ifdef CHROME_PERSONALIZATION url_util::AddStandardScheme(kPersonalizationScheme); URLRequest::RegisterProtocolFactory(kPersonalizationScheme, - &ChromeURLDataManager::Factory); + &ChromeURLDataManager::Factory); #endif } diff --git a/chrome/browser/dom_ui/dom_ui.cc b/chrome/browser/dom_ui/dom_ui.cc index 9b8b069..1f01e7d 100644 --- a/chrome/browser/dom_ui/dom_ui.cc +++ b/chrome/browser/dom_ui/dom_ui.cc @@ -27,7 +27,7 @@ DOMUI::~DOMUI() { void DOMUI::ProcessDOMUIMessage(const std::string& message, const std::string& content) { // Look up the callback for this message. - MessageCallbackMap::const_iterator callback = + MessageCallbackMap::const_iterator callback = message_callbacks_.find(message); if (callback == message_callbacks_.end()) return; @@ -74,7 +74,7 @@ void DOMUI::CallJavascriptFunction( ExecuteJavascript(javascript); } -void DOMUI::RegisterMessageCallback(const std::string &message, +void DOMUI::RegisterMessageCallback(const std::string &message, MessageCallback *callback) { message_callbacks_.insert(std::make_pair(message, callback)); } @@ -99,7 +99,7 @@ void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { void DOMUI::ExecuteJavascript(const std::wstring& javascript) { DCHECK(contents_); - contents_->render_view_host()->ExecuteJavascriptInWebFrame(std::wstring(), + contents_->render_view_host()->ExecuteJavascriptInWebFrame(std::wstring(), javascript); } @@ -111,7 +111,7 @@ DOMMessageHandler::DOMMessageHandler(DOMUI *dom_ui) : dom_ui_(dom_ui) { // DOMMessageHandler, protected: ---------------------------------------------- -void DOMMessageHandler::SetURLAndTitle(DictionaryValue* dictionary, +void DOMMessageHandler::SetURLAndTitle(DictionaryValue* dictionary, std::wstring title, const GURL& gurl) { std::wstring wstring_url = UTF8ToWide(gurl.spec()); diff --git a/chrome/browser/dom_ui/dom_ui.h b/chrome/browser/dom_ui/dom_ui.h index 3164d64..35388bd 100644 --- a/chrome/browser/dom_ui/dom_ui.h +++ b/chrome/browser/dom_ui/dom_ui.h @@ -91,7 +91,7 @@ class DOMMessageHandler { protected: // Adds "url" and "title" keys on incoming dictionary, setting title // as the url as a fallback on empty title. - static void SetURLAndTitle(DictionaryValue* dictionary, + static void SetURLAndTitle(DictionaryValue* dictionary, std::wstring title, const GURL& gurl); diff --git a/chrome/browser/dom_ui/dom_ui_contents.h b/chrome/browser/dom_ui/dom_ui_contents.h index 241f97f..42bfe89 100644 --- a/chrome/browser/dom_ui/dom_ui_contents.h +++ b/chrome/browser/dom_ui/dom_ui_contents.h @@ -119,7 +119,7 @@ class DOMUIContents : public WebContents { // // TabContents overrides - // + // virtual void UpdateHistoryForNavigation(const GURL& url, const ViewHostMsg_FrameNavigate_Params& params) { } virtual bool NavigateToPendingEntry(bool reload); diff --git a/chrome/browser/dom_ui/fileicon_source.cc b/chrome/browser/dom_ui/fileicon_source.cc index c2f75c4..d1e507c 100644 --- a/chrome/browser/dom_ui/fileicon_source.cc +++ b/chrome/browser/dom_ui/fileicon_source.cc @@ -41,7 +41,7 @@ void FileIconSource::StartDataRequest(const std::string& path, SendResponse(request_id, icon_data); } else { // Icon was not in cache, go fetch it slowly. - IconManager::Handle h = im->LoadIcon(UTF8ToWide(escaped_path), + IconManager::Handle h = im->LoadIcon(UTF8ToWide(escaped_path), IconLoader::NORMAL, &cancelable_consumer_, NewCallback(this, &FileIconSource::OnFileIconDataAvailable)); @@ -66,4 +66,4 @@ void FileIconSource::OnFileIconDataAvailable(IconManager::Handle handle, // TODO(glen): send a dummy icon. SendResponse(request_id, NULL); } -}
\ No newline at end of file +} diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index 9bc5d61..6e09592 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -186,7 +186,7 @@ void BrowsingHistoryHandler::HandleDeleteDay(const Value* value) { dom_ui_->CallJavascriptFunction(L"deleteFailed"); return; } - + // Anything in-flight is invalid. cancelable_consumer_.CancelAllRequests(); @@ -254,7 +254,7 @@ void BrowsingHistoryHandler::QueryComplete( base::TimeFormatShortDate(page.visit_time())); page_value->SetString(L"snippet", page.snippet().text()); } - page_value->SetBoolean(L"starred", + page_value->SetBoolean(L"starred", dom_ui_->get_profile()->GetBookmarkModel()->IsBookmarked(page.url())); results_value.Append(page_value); } diff --git a/chrome/browser/dom_ui/history_ui.h b/chrome/browser/dom_ui/history_ui.h index cc643b1..0902322 100644 --- a/chrome/browser/dom_ui/history_ui.h +++ b/chrome/browser/dom_ui/history_ui.h @@ -60,8 +60,8 @@ class BrowsingHistoryHandler : public DOMMessageHandler, history::QueryResults* results); // Extract the arguments from the call to HandleSearchHistory. - void ExtractSearchHistoryArguments(const Value* value, - int* month, + void ExtractSearchHistoryArguments(const Value* value, + int* month, std::wstring* query); // Figure out the query options for a month-wide query. @@ -72,7 +72,7 @@ class BrowsingHistoryHandler : public DOMMessageHandler, // Browsing history remover scoped_ptr<BrowsingDataRemover> remover_; - + // Our consumer for the history service. CancelableRequestConsumerTSimple<PageUsageData*> cancelable_consumer_; diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h index 98b0abe..c5a3c27 100644 --- a/chrome/browser/dom_ui/new_tab_ui.h +++ b/chrome/browser/dom_ui/new_tab_ui.h @@ -228,8 +228,8 @@ class HistoryHandler : public DOMMessageHandler { // Let the page contents record UMA actions. Only use when you can't do it from // C++. For example, we currently use it to let the NTP log the postion of the -// Most Visited or Bookmark the user clicked on, as we don't get that -// information through RequestOpenURL. You will need to update the metrics +// Most Visited or Bookmark the user clicked on, as we don't get that +// information through RequestOpenURL. You will need to update the metrics // dashboard with the action names you use, as our processor won't catch that // information (treat it as RecordComputedMetrics) class MetricsHandler : public DOMMessageHandler { diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h index 9a94e52..de1f3ab 100644 --- a/chrome/browser/download/download_manager.h +++ b/chrome/browser/download/download_manager.h @@ -378,7 +378,7 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, return FilePath::FromWStringHack(*download_path_); } - // Clears the last download path, used to initialize "save as" dialogs. + // Clears the last download path, used to initialize "save as" dialogs. void ClearLastDownloadPath(); // Registers this file extension for automatic opening upon download @@ -480,7 +480,7 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, // Renames a finished dangerous download from its temporary file name to its // real file name. // Invoked on the file thread. - void ProceedWithFinishedDangerousDownload(int64 download_handle, + void ProceedWithFinishedDangerousDownload(int64 download_handle, const FilePath& path, const FilePath& original_name); @@ -512,7 +512,7 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, // is the ID assigned by the ResourceDispatcherHost and the map does not own // the DownloadItems. It is used on shutdown to delete completed downloads // that have not been approved. - // + // // When a download is created through a user action, the corresponding // DownloadItem* is placed in 'in_progress_' and remains there until it has // received a valid handle from the history system. Once it has a valid diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index d8ceb41..7a1dd02 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -1051,7 +1051,7 @@ bool SavePackage::GetSaveInfo(const FilePath& suggest_name, if (param->save_type == SavePackage::SAVE_AS_COMPLETE_HTML) { // Make new directory for saving complete file. param->dir = param->dir.Append( - param->saved_main_file_path.RemoveExtension().BaseName().value() + + param->saved_main_file_path.RemoveExtension().BaseName().value() + FILE_PATH_LITERAL("_files")); } diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 5611594..32492cc 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -371,7 +371,7 @@ DictionaryValue* ExtensionsServiceBackend::ReadManifest( } if (header.header_size > sizeof(ExtensionHeader)) fseek(file.get(), header.header_size - sizeof(ExtensionHeader), SEEK_CUR); - + char buf[1 << 16]; std::string manifest_str; size_t read_size = std::min(sizeof(buf), header.manifest_size); @@ -495,7 +495,7 @@ bool ExtensionsServiceBackend::CheckCurrentVersion( // has actually loaded successfully. FilePath version_dir = dest_dir.AppendASCII(current_version_str); if (file_util::PathExists(version_dir)) { - ReportExtensionInstallError(dest_dir, + ReportExtensionInstallError(dest_dir, "Existing version is already up to date."); return false; } @@ -503,7 +503,7 @@ bool ExtensionsServiceBackend::CheckCurrentVersion( return true; } -bool ExtensionsServiceBackend::InstallDirSafely(const FilePath& source_dir, +bool ExtensionsServiceBackend::InstallDirSafely(const FilePath& source_dir, const FilePath& dest_dir) { if (file_util::PathExists(dest_dir)) { @@ -564,13 +564,13 @@ bool ExtensionsServiceBackend::SetCurrentVersion(const FilePath& dest_dir, // Restore the old CurrentVersion. if (file_util::PathExists(current_version_old)) { if (!file_util::Move(current_version_old, current_version)) { - LOG(WARNING) << "couldn't restore " << current_version_old.value() << + LOG(WARNING) << "couldn't restore " << current_version_old.value() << " to " << current_version.value(); // TODO(erikkay): This is an ugly state to be in. Try harder? } } - ReportExtensionInstallError(dest_dir, + ReportExtensionInstallError(dest_dir, "Couldn't create CurrentVersion file."); return false; } @@ -616,7 +616,7 @@ bool ExtensionsServiceBackend::InstallOrUpdateExtension( // If an expected id was provided, make sure it matches. if (expected_id.length() && expected_id != extension.id()) { - ReportExtensionInstallError(source_file, + ReportExtensionInstallError(source_file, "ID in new extension manifest does not match expected ID."); return false; } @@ -646,7 +646,7 @@ bool ExtensionsServiceBackend::InstallOrUpdateExtension( ScopedTempDir scoped_temp; scoped_temp.Set(temp_dir); if (!scoped_temp.IsValid()) { - ReportExtensionInstallError(source_file, + ReportExtensionInstallError(source_file, "Couldn't create temporary directory."); return false; } diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h index be3158c..56e0afa 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -137,7 +137,7 @@ class ExtensionsServiceBackend scoped_refptr<ExtensionsServiceFrontendInterface> frontend); // Check externally updated extensions for updates and install if necessary. - // Errors are reported through ExtensionErrorReporter. + // Errors are reported through ExtensionErrorReporter. // ReportExtensionInstalled is called on success. void CheckForExternalUpdates( scoped_refptr<ExtensionsServiceFrontendInterface> frontend); diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc index c37e1bb..c6ac773 100644 --- a/chrome/browser/extensions/user_script_master.cc +++ b/chrome/browser/extensions/user_script_master.cc @@ -155,7 +155,7 @@ base::SharedMemory* UserScriptMaster::ScriptReloader::GetNewScripts( file = enumerator.Next()) { all_scripts.push_back(UserScript()); UserScript& info = all_scripts.back(); - info.set_url(GURL(std::string(chrome::kUserScriptScheme) + ":/" + + info.set_url(GURL(std::string(chrome::kUserScriptScheme) + ":/" + net::FilePathToFileURL(file.ToWStringHack()).ExtractFileName())); info.set_path(file); } diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index e637a16..416afe2 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -283,7 +283,7 @@ void ExternalTabContainer::Observe(NotificationType type, const NavigationController::LoadCommittedDetails* commit = Details<NavigationController::LoadCommittedDetails>(details).ptr(); - if (commit->http_status_code >= kHttpClientErrorStart && + if (commit->http_status_code >= kHttpClientErrorStart && commit->http_status_code <= kHttpServerErrorEnd) { automation_->Send(new AutomationMsg_NavigationFailed( 0, commit->http_status_code, commit->entry->url())); diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index 34d94e1..66d6d74 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -83,7 +83,7 @@ bool GetBackupChromeFile(std::wstring* path) { return true; } -std::wstring GetDefaultPrefFilePath(bool create_profile_dir, +std::wstring GetDefaultPrefFilePath(bool create_profile_dir, const std::wstring& user_data_dir) { FilePath default_pref_dir = ProfileManager::GetDefaultProfileDir( FilePath::FromWStringHack(user_data_dir)); @@ -218,7 +218,7 @@ bool FirstRun::ProcessMasterPreferences( // result determines if we continue or not. We wait here until the user // dismisses the dialog. int retcode = 0; - if (!LaunchSetupWithParam(installer_util::switches::kShowEula, &retcode) || + if (!LaunchSetupWithParam(installer_util::switches::kShowEula, &retcode) || (retcode == installer_util::EULA_REJECTED)) { LOG(WARNING) << "EULA rejected. Fast exit."; ::ExitProcess(1); @@ -457,7 +457,7 @@ class FirstRunImportObserver : public ImportObserver { import_result_ = ResultCodes::NORMAL_EXIT; Finish(); } - + void RunLoop() { loop_running_ = true; MessageLoop::current()->Run(); diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc index 4017899..f60148c 100644 --- a/chrome/browser/gears_integration.cc +++ b/chrome/browser/gears_integration.cc @@ -134,7 +134,7 @@ static GURL ConvertSkBitmapToDataURL(const SkBitmap& icon) { class CreateShortcutCommand : public CPCommandInterface { public: CreateShortcutCommand( - const std::string& name, const std::string& orig_name, + const std::string& name, const std::string& orig_name, const std::string& url, const std::string& description, const std::vector<webkit_glue::WebApplicationInfo::IconInfo> &icons, const SkBitmap& fallback_icon, diff --git a/chrome/browser/google_update.cc b/chrome/browser/google_update.cc index 17f30b3..70ee2ab 100644 --- a/chrome/browser/google_update.cc +++ b/chrome/browser/google_update.cc @@ -35,7 +35,7 @@ bool CanUpdateCurrentChrome(const std::wstring& chrome_exe_path) { user_exe_path.begin(), tolower); std::transform(machine_exe_path.begin(), machine_exe_path.end(), machine_exe_path.begin(), tolower); - if (chrome_exe_path != user_exe_path && + if (chrome_exe_path != user_exe_path && chrome_exe_path != machine_exe_path ) { LOG(ERROR) << L"Google Update cannot update Chrome installed in a " << L"non-standard location: " << chrome_exe_path.c_str() diff --git a/chrome/browser/history/query_parser.cc b/chrome/browser/history/query_parser.cc index 3ebaad9..cb9cf40 100644 --- a/chrome/browser/history/query_parser.cc +++ b/chrome/browser/history/query_parser.cc @@ -291,7 +291,7 @@ void QueryParser::ExtractQueryWords(const std::wstring& query, QueryNodeList root; if (!ParseQueryImpl(query, &root)) return; - root.AppendWords(words); + root.AppendWords(words); } bool QueryParser::DoesQueryMatch(const std::wstring& text, diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index d133d22..2feea81 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -230,7 +230,7 @@ void TextDatabaseManager::AddPageContents(const GURL& url, // took more than kExpirationSec to load. Often, this will be the result of // a very slow iframe or other resource on the page that makes us think its // still loading. - // + // // As a fallback, set the most recent visit's contents using the input, and // use the last set title in the URL table as the title to index. URLRow url_row; diff --git a/chrome/browser/history/url_database_unittest.cc b/chrome/browser/history/url_database_unittest.cc index a33829a..1ee1351 100644 --- a/chrome/browser/history/url_database_unittest.cc +++ b/chrome/browser/history/url_database_unittest.cc @@ -28,7 +28,7 @@ bool IsURLRowEqual(const URLRow& a, a.last_visit() - b.last_visit() <= TimeDelta::FromSeconds(1) && a.hidden() == b.hidden(); } - + } // namespace class URLDatabaseTest : public testing::Test, diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 8dfddd2..d1dbe05 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -140,7 +140,7 @@ void Firefox2Importer::ImportBookmarksFile( file_util::ReadFileToString(file_path, &content); std::vector<std::string> lines; SplitString(content, '\n', &lines); - + std::vector<ProfileWriter::BookmarkEntry> toolbar_bookmarks; std::wstring last_folder = first_folder_name; bool last_folder_on_toolbar = false; diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index e9b83c5..f4f4f07 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -106,7 +106,7 @@ class ProfileWriter : public base::RefCounted<ProfileWriter> { #endif virtual void AddHistoryPage(const std::vector<history::URLRow>& page); virtual void AddHomepage(const GURL& homepage); - // Adds the bookmarks to the BookmarkModel. + // Adds the bookmarks to the BookmarkModel. // |options| is a bitmask of BookmarkOptions and dictates how and // which bookmarks are added. If the bitmask contains FIRST_RUN, // then any entries with a value of true for in_toolbar are added to @@ -385,7 +385,7 @@ class Importer : public base::RefCounted<Importer> { // The importer should know the main thread so that ProfileWriter // will be invoked in thread instead. MessageLoop* main_loop_; - + // The message loop in which the importer operates. MessageLoop* delagate_loop_; diff --git a/chrome/browser/navigation_controller_unittest.cc b/chrome/browser/navigation_controller_unittest.cc index 0bdd613..3dd303d 100644 --- a/chrome/browser/navigation_controller_unittest.cc +++ b/chrome/browser/navigation_controller_unittest.cc @@ -396,7 +396,7 @@ TEST_F(NavigationControllerTest, LoadURL_NoPending) { contents->CompleteNavigationAsRenderer(0, kExistingURL1); EXPECT_TRUE(notifications.Check1AndReset( NotificationType::NAV_ENTRY_COMMITTED)); - + // Do a new navigation without making a pending one. const GURL kNewURL(scheme1() + ":see"); contents->CompleteNavigationAsRenderer(99, kNewURL); @@ -708,7 +708,7 @@ TEST_F(NavigationControllerTest, Back_OtherBackPending) { // Not synthesize a totally new back event to the first page. This will not // match the pending one. contents->CompleteNavigationAsRenderer(0, kUrl1); - + // The navigation should not have affected the pending entry. EXPECT_EQ(1, contents->controller()->GetPendingEntryIndex()); @@ -1172,7 +1172,7 @@ TEST_F(NavigationControllerTest, SwitchTypesCleanup) { // Now that the tasks have been flushed, the first tab type should be gone. ASSERT_TRUE( contents->controller()->GetTabContents(type1()) == NULL); - ASSERT_EQ(contents, + ASSERT_EQ(contents, contents->controller()->GetTabContents(type2())); } @@ -1444,7 +1444,7 @@ TEST_F(NavigationControllerTest, TransientEntry) { // We should have navigated, transient entry should be gone. EXPECT_EQ(url2, contents->controller()->GetActiveEntry()->url()); EXPECT_EQ(contents->controller()->GetEntryCount(), 3); - + // Add a transient again, then navigate with no pending entry this time. transient_entry = new NavigationEntry(TAB_CONTENTS_WEB); transient_entry->set_url(transient_url); @@ -1477,7 +1477,7 @@ TEST_F(NavigationControllerTest, TransientEntry) { EXPECT_EQ(url4, contents->controller()->GetActiveEntry()->url()); EXPECT_EQ(contents->controller()->GetEntryCount(), 5); contents->CompleteNavigationAsRenderer(3, url3); - + // Add a transient and go to an entry before the current one. transient_entry = new NavigationEntry(TAB_CONTENTS_WEB); transient_entry->set_url(transient_url); diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 351107a..a33716e 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -187,7 +187,7 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile) user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); prefs_->AddPrefObserver(prefs::kAcceptLanguages, this); - prefs_->AddPrefObserver(prefs::kCookieBehavior, this); + prefs_->AddPrefObserver(prefs::kCookieBehavior, this); NotificationService::current()->AddObserver( this, NotificationType::EXTENSIONS_LOADED, diff --git a/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc b/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc index a1b8d70..7dba1db 100644 --- a/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc +++ b/chrome/browser/net/resolve_proxy_msg_helper_unittest.cc @@ -36,7 +36,7 @@ class MockProxyResolver : public net::ProxyResolver { results->UseNamedProxy(query_url.host()); return net::OK; } - + void Block() { is_blocked_ = true; event_.Reset(); @@ -78,7 +78,7 @@ struct ResultFuture { bool TimedWaitUntilDone(const base::TimeDelta& max_time) { return completed_.TimedWait(max_time); } - + // These fields are only valid after returning from WaitUntilDone(). IPC::Message* reply_msg; int error_code; diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc index e961904..ae6e672 100644 --- a/chrome/browser/password_manager/password_manager.cc +++ b/chrome/browser/password_manager/password_manager.cc @@ -32,7 +32,7 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { form_to_save_(form_to_save) { } - virtual ~SavePasswordInfoBarDelegate() { } + virtual ~SavePasswordInfoBarDelegate() { } // Overridden from ConfirmInfoBarDelegate: virtual void InfoBarClosed() { @@ -72,7 +72,7 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { form_to_save_->PermanentlyBlacklist(); return true; } - + private: // The PasswordFormManager managing the form we're asking the user about, // and should update as per her decision. @@ -172,7 +172,7 @@ void PasswordManager::DidStopLoading() { if (provisional_save_manager_->IsNewLogin()) { web_contents_->AddInfoBar( new SavePasswordInfoBarDelegate(web_contents_, - provisional_save_manager_.release())); + provisional_save_manager_.release())); } else { // If the save is not a new username entry, then we just want to save this // data (since the user already has related data saved), so don't prompt. diff --git a/chrome/browser/password_manager/password_manager.h b/chrome/browser/password_manager/password_manager.h index 96171fe..2ded7d2 100644 --- a/chrome/browser/password_manager/password_manager.h +++ b/chrome/browser/password_manager/password_manager.h @@ -34,7 +34,7 @@ class PasswordManager : public views::LoginModel { const PasswordFormMap& best_matches, const PasswordForm* const preferred_match) const; - // Notification that the user navigated away from the current page. + // Notification that the user navigated away from the current page. // Unless this is a password form submission, for our purposes this // means we're done with the current page, so we can clean-up. void DidNavigate(); @@ -59,10 +59,10 @@ class PasswordManager : public views::LoginModel { observer_ = observer; } - private: + private: // Note about how a PasswordFormManager can transition from // pending_login_managers_ to provisional_save_manager_ and the infobar. - // + // // 1. form "seen" // | new // | ___ Infobar diff --git a/chrome/browser/printing/page_number_unittest.cc b/chrome/browser/printing/page_number_unittest.cc index 2656b86..c25e1bc 100644 --- a/chrome/browser/printing/page_number_unittest.cc +++ b/chrome/browser/printing/page_number_unittest.cc @@ -16,7 +16,7 @@ TEST(PageNumberTest, Count) { ++page; EXPECT_EQ(1, page.ToInt()); EXPECT_NE(printing::PageNumber::npos(), page); - + printing::PageNumber page_copy(page); EXPECT_EQ(1, page_copy.ToInt()); EXPECT_EQ(1, page.ToInt()); diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 979c263..3edd32d 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -373,10 +373,10 @@ void ProfileImpl::InitExtensions() { const CommandLine* command_line = CommandLine::ForCurrentProcess(); PrefService* prefs = GetPrefs(); bool user_scripts_enabled = - command_line->HasSwitch(switches::kEnableUserScripts) || + command_line->HasSwitch(switches::kEnableUserScripts) || prefs->GetBoolean(prefs::kEnableUserScripts); bool extensions_enabled = - command_line->HasSwitch(switches::kEnableExtensions) || + command_line->HasSwitch(switches::kEnableExtensions) || prefs->GetBoolean(prefs::kEnableExtensions); FilePath script_dir; diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 8c93886..7e48419 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -217,7 +217,7 @@ class Profile { virtual void ResetTabRestoreService() = 0; - // This reinitializes the spellchecker according to the current dictionary + // This reinitializes the spellchecker according to the current dictionary // language, and enable spell check option, in the prefs. virtual void ReinitializeSpellChecker() = 0; @@ -230,7 +230,7 @@ class Profile { // // NOTE: this is invoked internally on a normal shutdown, but is public so // that it can be invoked when the user logs out/powers down (WM_ENDSESSION). - virtual void MarkAsCleanShutdown() = 0; + virtual void MarkAsCleanShutdown() = 0; virtual void InitExtensions() = 0; @@ -305,7 +305,7 @@ class ProfileImpl : public Profile, // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, - const NotificationDetails& details); + const NotificationDetails& details); private: friend class Profile; @@ -316,20 +316,20 @@ class ProfileImpl : public Profile, FilePath GetPrefFilePath(); void StopCreateSessionServiceTimer(); - + void EnsureSessionServiceCreated() { GetSessionService(); } // Initializes the spellchecker. If the spellchecker already exsts, then - // it is released, and initialized again. This model makes sure that + // it is released, and initialized again. This model makes sure that // spellchecker language can be changed without restarting the browser. // NOTE: This is being currently called in the UI thread, which is OK as long // as the spellchecker object is USED in the IO thread. // The |need_to_broadcast| parameter tells it whether to broadcast the new // spellchecker to the resource message filters. void InitializeSpellChecker(bool need_to_broadcast); - + FilePath path_; bool off_the_record_; scoped_ptr<VisitedLinkMaster> visited_link_master_; diff --git a/chrome/browser/profile_manager_unittest.cc b/chrome/browser/profile_manager_unittest.cc index be505d0..ed47ef0 100644 --- a/chrome/browser/profile_manager_unittest.cc +++ b/chrome/browser/profile_manager_unittest.cc @@ -28,7 +28,7 @@ protected: ASSERT_TRUE(file_util::Delete(test_dir_, true)); ASSERT_FALSE(file_util::PathExists(test_dir_)); } - + MessageLoopForUI message_loop_; // the path to temporary directory used to contain the test operations diff --git a/chrome/browser/renderer_host/audio_renderer_host_unittest.cc b/chrome/browser/renderer_host/audio_renderer_host_unittest.cc index 2942dac..8efa3e34 100644 --- a/chrome/browser/renderer_host/audio_renderer_host_unittest.cc +++ b/chrome/browser/renderer_host/audio_renderer_host_unittest.cc @@ -20,7 +20,7 @@ class AudioRendererHostTest : public testing::Test { // This task post a task to message_loop_ to do internal destruction on // message_loop_. host_->Destroy(); - // We need to continue running message_loop_ to complete all destructions. + // We need to continue running message_loop_ to complete all destructions. message_loop_->RunAllPending(); } diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index 6439a14..e1144c2 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -94,7 +94,7 @@ bool BufferedResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, bool ret = real_handler_->OnWillRead(request_id, buf, buf_size, min_size); read_buffer_ = *buf; read_buffer_size_ = *buf_size; - DCHECK(read_buffer_size_ >= kMaxBytesToSniff * 2); + DCHECK(read_buffer_size_ >= kMaxBytesToSniff * 2); bytes_read_ = 0; return ret; } diff --git a/chrome/browser/renderer_host/render_view_host_unittest.cc b/chrome/browser/renderer_host/render_view_host_unittest.cc index 564810c..237b228 100644 --- a/chrome/browser/renderer_host/render_view_host_unittest.cc +++ b/chrome/browser/renderer_host/render_view_host_unittest.cc @@ -1,17 +1,17 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/test_render_view_host.h"
-#include "chrome/browser/tab_contents/navigation_entry.h"
-
-class RenderViewHostTest : public RenderViewHostTestHarness {
-};
-
-// All about URLs reported by the renderer should get rewritten to about:blank.
-// See RenderViewHost::OnMsgNavigate for a discussion.
-TEST_F(RenderViewHostTest, FilterAbout) {
- rvh()->SendNavigate(1, GURL("about:cache"));
- ASSERT_TRUE(controller_->GetActiveEntry());
- EXPECT_EQ(GURL("about:blank"), controller_->GetActiveEntry()->url());
-}
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/renderer_host/test_render_view_host.h" +#include "chrome/browser/tab_contents/navigation_entry.h" + +class RenderViewHostTest : public RenderViewHostTestHarness { +}; + +// All about URLs reported by the renderer should get rewritten to about:blank. +// See RenderViewHost::OnMsgNavigate for a discussion. +TEST_F(RenderViewHostTest, FilterAbout) { + rvh()->SendNavigate(1, GURL("about:cache")); + ASSERT_TRUE(controller_->GetActiveEntry()); + EXPECT_EQ(GURL("about:blank"), controller_->GetActiveEntry()->url()); +} diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h index 54819e1..54ff098 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.h +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h @@ -48,11 +48,11 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { // deleted it will delete this out from under the caller. explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); virtual ~RenderWidgetHostViewMac(); - + RenderWidgetHost* render_widget_host() const { return render_widget_host_; } - + base::TimeTicks& whiteout_start_time() { return whiteout_start_time_; } - + gfx::NativeView native_view() const { return cocoa_view_; } // Implementation of RenderWidgetHostView: diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index e8d9c25..85e29cc 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -142,13 +142,13 @@ void RenderWidgetHostViewMac::UpdateCursorIfOverSelf() { NSEvent* event = [[cocoa_view_ window] currentEvent]; if ([event window] != [cocoa_view_ window]) return; - + NSPoint event_location = [event locationInWindow]; NSPoint local_point = [cocoa_view_ convertPoint:event_location fromView:nil]; - + if (!NSPointInRect(local_point, [cocoa_view_ bounds])) return; - + NSCursor* ns_cursor = current_cursor_.GetCursor(); [ns_cursor set]; } @@ -181,7 +181,7 @@ void RenderWidgetHostViewMac::DidScrollRect( [cocoa_view_ scrollRect:[cocoa_view_ RectToNSRect:rect] by:NSMakeSize(dx, -dy)]; - + gfx::Rect new_rect = rect; new_rect.Offset(dx, dy); gfx::Rect dirty_rect = rect.Subtract(new_rect); @@ -240,7 +240,7 @@ void RenderWidgetHostViewMac::ShutdownHost() { - (void)dealloc { delete renderWidgetHostView_; - + [super dealloc]; } @@ -289,7 +289,7 @@ void RenderWidgetHostViewMac::ShutdownHost() { canvas->getTopPlatformDevice().DrawToContext( context, damaged_rect_ns.origin.x, damaged_rect_ns.origin.y, &damaged_rect_cg); - + [self unlockFocus]; } } @@ -341,13 +341,13 @@ void RenderWidgetHostViewMac::ShutdownHost() { - (BOOL)becomeFirstResponder { renderWidgetHostView_->render_widget_host()->Focus(); - + return YES; } - (BOOL)resignFirstResponder { renderWidgetHostView_->render_widget_host()->Blur(); - + return YES; } diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h index 452798e..a64463f 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host.h @@ -247,7 +247,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { int pending_requests() const { return static_cast<int>(pending_requests_.size()); } - + // Intended for unit-tests only. Returns the memory cost of all the // outstanding requests (pending and blocked) for |render_process_host_id|. int GetOutstandingRequestsMemoryCost(int render_process_host_id) const; @@ -412,7 +412,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // data structures supporting this request (URLRequest object, // HttpNetworkTransaction, etc...). // The value of |cost| is added to the running total, and the resulting - // sum is returned. + // sum is returned. int IncrementOutstandingRequestsMemoryCost(int cost, int render_process_host_id); @@ -508,7 +508,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { typedef std::map<ProcessRendererIDs, BlockedRequestsList*> BlockedRequestMap; BlockedRequestMap blocked_requests_map_; - // Maps the render_process_host_ids to the approximate number of bytes + // Maps the render_process_host_ids to the approximate number of bytes // being used to service its resource requests. No entry implies 0 cost. typedef std::map<int, int> OutstandingRequestsMemoryCostMap; OutstandingRequestsMemoryCostMap outstanding_requests_memory_cost_map_; diff --git a/chrome/browser/renderer_host/test_render_view_host.h b/chrome/browser/renderer_host/test_render_view_host.h index a925c67..5f558b1 100644 --- a/chrome/browser/renderer_host/test_render_view_host.h +++ b/chrome/browser/renderer_host/test_render_view_host.h @@ -69,7 +69,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { virtual void PrepareToDestroy() {} virtual void SetTooltipText(const std::wstring& tooltip_text) {} virtual BackingStore* AllocBackingStore(const gfx::Size& size); - + bool is_showing() const { return is_showing_; } private: diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index 84ba46f..b310d57 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -109,11 +109,11 @@ bool LoadRLZLibrary(int directory_key) { bool SendFinancialPing(const wchar_t* brand, const wchar_t* lang, const wchar_t* referral, bool exclude_id) { - RLZTracker::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, + RLZTracker::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, RLZTracker::CHROME_HOME_PAGE, RLZTracker::NO_ACCESS_POINT}; if (!send_ping) - return false; + return false; return send_ping(RLZTracker::CHROME, points, L"chrome", brand, referral, lang, exclude_id, NULL); } @@ -138,7 +138,7 @@ class OmniBoxUsageObserver : public NotificationObserver { // attempt the ping. if (!RLZTracker::RecordProductEvent(RLZTracker::CHROME, RLZTracker::CHROME_OMNIBOX, - RLZTracker::FIRST_SEARCH)) + RLZTracker::FIRST_SEARCH)) omnibox_used_ = true; delete this; } @@ -156,7 +156,7 @@ class OmniBoxUsageObserver : public NotificationObserver { // Dtor is private so the object cannot be created on the stack. ~OmniBoxUsageObserver() { NotificationService::current()->RemoveObserver(this, - NotificationType::OMNIBOX_OPENED_URL, + NotificationType::OMNIBOX_OPENED_URL, NotificationService::AllSources()); instance_ = NULL; } @@ -249,7 +249,7 @@ class DelayedInitTask : public Task { if (OmniBoxUsageObserver::used()) { RLZTracker::RecordProductEvent(RLZTracker::CHROME, RLZTracker::CHROME_OMNIBOX, - RLZTracker::FIRST_SEARCH); + RLZTracker::FIRST_SEARCH); } } // Schedule the daily RLZ ping. diff --git a/chrome/browser/safe_browsing/protocol_parser_unittest.cc b/chrome/browser/safe_browsing/protocol_parser_unittest.cc index 289df72..bc37118 100644 --- a/chrome/browser/safe_browsing/protocol_parser_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_parser_unittest.cc @@ -507,7 +507,7 @@ TEST(SafeBrowsingProtocolParsingTest, TestGetHashWithUnknownList) { &full_hashes)); EXPECT_EQ(full_hashes.size(), static_cast<size_t>(1)); - EXPECT_EQ(memcmp("12345678901234567890123456789012", + EXPECT_EQ(memcmp("12345678901234567890123456789012", &full_hashes[0].hash, sizeof(SBFullHash)), 0); EXPECT_EQ(full_hashes[0].list_name, "goog-phish-shavar"); EXPECT_EQ(full_hashes[0].add_chunk_id, 1); @@ -522,11 +522,11 @@ TEST(SafeBrowsingProtocolParsingTest, TestGetHashWithUnknownList) { &full_hashes)); EXPECT_EQ(full_hashes.size(), static_cast<size_t>(2)); - EXPECT_EQ(memcmp("12345678901234567890123456789012", + EXPECT_EQ(memcmp("12345678901234567890123456789012", &full_hashes[0].hash, sizeof(SBFullHash)), 0); EXPECT_EQ(full_hashes[0].list_name, "goog-phish-shavar"); EXPECT_EQ(full_hashes[0].add_chunk_id, 1); - EXPECT_EQ(memcmp("abcdefghijklmnopqrstuvwxyz123457", + EXPECT_EQ(memcmp("abcdefghijklmnopqrstuvwxyz123457", &full_hashes[1].hash, sizeof(SBFullHash)), 0); EXPECT_EQ(full_hashes[1].list_name, "goog-malware-shavar"); EXPECT_EQ(full_hashes[1].add_chunk_id, 7); @@ -632,7 +632,7 @@ TEST(SafeBrowsingProtocolParsingTest, TestZeroSizeAddChunk) { EXPECT_EQ(chunks[1].chunk_number, 2); EXPECT_EQ(chunks[1].hosts.size(), static_cast<size_t>(0)); - + EXPECT_EQ(chunks[2].chunk_number, 3); EXPECT_EQ(chunks[2].hosts.size(), static_cast<size_t>(1)); EXPECT_EQ(chunks[2].hosts[0].host, 0x65666163); diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc index e69ae04..a05933d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc @@ -870,7 +870,7 @@ bool SafeBrowsingDatabaseBloom::BuildAddPrefixList(SBPair* adds) { } bool SafeBrowsingDatabaseBloom::RemoveSubs( - SBPair* adds, std::vector<bool>* adds_removed, + SBPair* adds, std::vector<bool>* adds_removed, HashCache* add_cache, HashCache* sub_cache, int* subs) { DCHECK(add_cache && sub_cache && subs); diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index 4acdf3a..03a372d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc @@ -943,7 +943,7 @@ TEST(SafeBrowsingDatabase, HashCaching) { database->UpdateFinished(true); EXPECT_TRUE(database->ContainsUrl(GURL("http://www.fullevil.com/bad1.html"), - &listname, &prefixes, &full_hashes, + &listname, &prefixes, &full_hashes, Time::Now())); EXPECT_EQ(full_hashes.size(), 1U); EXPECT_EQ(0, memcmp(full_hashes[0].hash.full_hash, @@ -954,7 +954,7 @@ TEST(SafeBrowsingDatabase, HashCaching) { full_hashes.clear(); EXPECT_TRUE(database->ContainsUrl(GURL("http://www.fullevil.com/bad2.html"), - &listname, &prefixes, &full_hashes, + &listname, &prefixes, &full_hashes, Time::Now())); EXPECT_EQ(full_hashes.size(), 1U); EXPECT_EQ(0, memcmp(full_hashes[0].hash.full_hash, @@ -986,13 +986,13 @@ TEST(SafeBrowsingDatabase, HashCaching) { database->UpdateFinished(true); EXPECT_FALSE(database->ContainsUrl(GURL("http://www.fullevil.com/bad1.html"), - &listname, &prefixes, &full_hashes, + &listname, &prefixes, &full_hashes, Time::Now())); EXPECT_EQ(full_hashes.size(), 0U); // There should be one remaining full add. EXPECT_TRUE(database->ContainsUrl(GURL("http://www.fullevil.com/bad2.html"), - &listname, &prefixes, &full_hashes, + &listname, &prefixes, &full_hashes, Time::Now())); EXPECT_EQ(full_hashes.size(), 1U); EXPECT_EQ(0, memcmp(full_hashes[0].hash.full_hash, @@ -1010,10 +1010,10 @@ TEST(SafeBrowsingDatabase, HashCaching) { lists.clear(); EXPECT_FALSE(database->ContainsUrl(GURL("http://www.fullevil.com/bad1.html"), - &listname, &prefixes, &full_hashes, + &listname, &prefixes, &full_hashes, Time::Now())); EXPECT_FALSE(database->ContainsUrl(GURL("http://www.fullevil.com/bad2.html"), - &listname, &prefixes, &full_hashes, + &listname, &prefixes, &full_hashes, Time::Now())); TearDownTestDatabase(database); diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 04fb702..967ebc6 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -224,7 +224,7 @@ bool SafeBrowsingService::CheckUrlNew(const GURL& url, Client* client) { bool prefix_match = database_->ContainsUrl(url, &list, &prefix_hits, &full_hits, protocol_manager_->last_update()); - + UMA_HISTOGRAM_TIMES("SB2.FilterCheck", base::Time::Now() - check_start); if (!prefix_match) diff --git a/chrome/browser/safe_browsing/safe_browsing_util_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_util_unittest.cc index 2486117..2c59a66 100644 --- a/chrome/browser/safe_browsing/safe_browsing_util_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_util_unittest.cc @@ -266,7 +266,7 @@ TEST(SafeBrowsing, HostInfo2) { // Checks that if we get a sub chunk with one prefix, then get the add chunk // for that same prefix afterwards, the entry becomes empty. -TEST(SafeBrowsing, HostInfo3) { +TEST(SafeBrowsing, HostInfo3) { SBHostInfo info; // Add a sub prefix. diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc index d4fa96c..cee6160 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc @@ -32,7 +32,7 @@ struct PrepopulatedEngine { // someone asks. Only entries which need keywords to auto-track a dynamically // generated search URL should use this. // If the empty string, the engine has no keyword. - const wchar_t* const keyword; + const wchar_t* const keyword; const char* const favicon_url; // If NULL, there is no favicon. const wchar_t* const search_url; const char* const encoding; @@ -1978,7 +1978,7 @@ const PrepopulatedEngine yahoo_hk = { "UTF-8", // http://history.hk.search.yahoo.com/ac/ac_msearch.php?query={searchTerms} // returns a JSON with key-value pairs. Setting parameters (ot, of, output) - // to fxjson, json, or js doesn't help. + // to fxjson, json, or js doesn't help. NULL, 2, }; @@ -2694,12 +2694,12 @@ int CountryCharsToCountryIDWithUpdate(char c1, char c2) { c1 = 'R'; c2 = 'S'; } - + // SPECIAL CASE: Timor-Leste changed from 'TP' to 'TL' in 2002. Windows XP // predates this; we therefore map this value. if (c1 == 'T' && c2 == 'P') c2 = 'L'; - + return CountryCharsToCountryID(c1, c2); } @@ -2711,7 +2711,7 @@ int GeoIDToCountryID(GEOID geo_id) { const int kISOBufferSize = 3; // Two plus one for the terminator. wchar_t isobuf[kISOBufferSize] = { 0 }; int retval = GetGeoInfo(geo_id, GEO_ISO2, isobuf, kISOBufferSize, 0); - + if (retval == kISOBufferSize && !(isobuf[0] == L'X' && isobuf[1] == L'X')) return CountryCharsToCountryIDWithUpdate(static_cast<char>(isobuf[0]), @@ -2725,7 +2725,7 @@ int GeoIDToCountryID(GEOID geo_id) { return CountryCharsToCountryID('J', 'E'); case 0x3B16: // Isle of Man return CountryCharsToCountryID('I', 'M'); - + // 'UM' (U.S. Minor Outlying Islands) case 0x7F: // Johnston Atoll case 0x102: // Wake Island @@ -2762,7 +2762,7 @@ int GeoIDToCountryID(GEOID geo_id) { int GetCurrentCountryID() { GEOID geo_id = GetUserGeoID(GEOCLASS_NATION); - + return GeoIDToCountryID(geo_id); } diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index 29bbf7b..8423478 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -153,7 +153,7 @@ SessionCommand* BaseSessionService::CreateUpdateTabNavigationCommand( std::numeric_limits<SessionCommand::size_type>::max() - 1024; int bytes_written = 0; - + WriteStringToPickle(pickle, &bytes_written, max_state_size, entry.display_url().spec()); diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 780f4f1..5edabd9 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -812,7 +812,7 @@ bool SessionService::CreateTabsAndWindows( // Update the selected navigation index. tab->current_navigation_index = std::max(-1, tab->current_navigation_index - payload.index); - + // And update the index of existing navigations. for (std::vector<TabNavigation>::iterator i = tab->navigations.begin(); i != tab->navigations.end();) { diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc index 134a898..b49e3f6 100644 --- a/chrome/browser/sessions/tab_restore_service.cc +++ b/chrome/browser/sessions/tab_restore_service.cc @@ -34,7 +34,7 @@ const size_t TabRestoreService::kMaxEntries = 10; // Identifier for commands written to file. // The ordering in the file is as follows: -// . When the user closes a tab a command of type +// . When the user closes a tab a command of type // kCommandSelectedNavigationInTab is written identifying the tab and // the selected index. This is followed by any number of // kCommandUpdateTabNavigation commands (1 per navigation entry). diff --git a/chrome/browser/sessions/tab_restore_service_unittest.cc b/chrome/browser/sessions/tab_restore_service_unittest.cc index bc5aefc..4537c8b 100644 --- a/chrome/browser/sessions/tab_restore_service_unittest.cc +++ b/chrome/browser/sessions/tab_restore_service_unittest.cc @@ -118,7 +118,7 @@ TEST_F(TabRestoreServiceTest, Basic) { // There should be two entries now. ASSERT_EQ(2, service_->entries().size()); - // Make sure the entry matches + // Make sure the entry matches entry = service_->entries().front(); ASSERT_EQ(TabRestoreService::TAB, entry->type); tab = static_cast<TabRestoreService::Tab*>(entry); diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 271ec00..f4dc667 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -36,7 +36,7 @@ class LinkInfoBarDelegate; // and the delegate is free to clean itself up or reset state, which may have // fatal consequences for the InfoBar that was in the process of opening (or is // now fully opened) -- it is referencing a delegate that may not even exist -// anymore. +// anymore. // As such, it is generally much safer to dedicate a delegate instance to // AddInfoBar! class InfoBarDelegate { @@ -149,7 +149,7 @@ class LinkInfoBarDelegate : public InfoBarDelegate { // closed now or false if it should remain until the user explicitly closes // it. virtual bool LinkClicked(WindowOpenDisposition disposition) { - return true; + return true; } // Overridden from InfoBarDelegate: diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index e0ebd23..857068f 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -359,7 +359,7 @@ void InterstitialPage::DidNavigate( // The RenderViewHost has loaded its contents, we can show it now. render_view_host_->view()->Show(); - tab_->set_interstitial_page(this); + tab_->set_interstitial_page(this); // Notify the tab we are not loading so the throbber is stopped. It also // causes a NOTIFY_LOAD_STOP notification, that the AutomationProvider (used @@ -409,7 +409,7 @@ void InterstitialPage::Disable() { void InterstitialPage::TakeActionOnResourceDispatcher( ResourceRequestAction action) { - DCHECK(MessageLoop::current() == ui_loop_) << + DCHECK(MessageLoop::current() == ui_loop_) << "TakeActionOnResourceDispatcher should be called on the main thread."; if (action == CANCEL || action == RESUME) { diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index d05d0aa..b77d525 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -185,4 +185,4 @@ class InterstitialPage : public NotificationObserver, }; #endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ - + diff --git a/chrome/browser/tab_contents/render_view_context_menu_controller.cc b/chrome/browser/tab_contents/render_view_context_menu_controller.cc index 4afcc86..88ca046 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_controller.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_controller.cc @@ -220,7 +220,7 @@ bool RenderViewContextMenuController::IsItemChecked(int id) const { // Check box for 'Check the Spelling of this field'. if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD) return params_.spellcheck_enabled; - + // Don't bother getting the display language vector if this isn't a spellcheck // language. if ((id < IDC_SPELLCHECK_LANGUAGES_FIRST) || @@ -272,7 +272,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { if (id >= IDC_SPELLCHECK_LANGUAGES_FIRST && id < IDC_SPELLCHECK_LANGUAGES_LAST) { const size_t language_number = id - IDC_SPELLCHECK_LANGUAGES_FIRST; - SpellChecker::Languages display_languages; + SpellChecker::Languages display_languages; SpellChecker::GetSpellCheckLanguagesToDisplayInContextMenu( source_web_contents_->profile(), &display_languages); if (language_number < display_languages.size()) { @@ -281,7 +281,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { source_web_contents_->profile()->GetPrefs(), NULL); dictionary_language.SetValue(display_languages[language_number]); } - + return; } @@ -363,7 +363,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { source_web_contents_->profile(), nav_entry, source_web_contents_->GetContentNativeView(), - PageInfoWindow::SECURITY); + PageInfoWindow::SECURITY); break; } diff --git a/chrome/browser/tab_contents/render_view_host_manager.cc b/chrome/browser/tab_contents/render_view_host_manager.cc index b1062bc..1b7b6a5 100644 --- a/chrome/browser/tab_contents/render_view_host_manager.cc +++ b/chrome/browser/tab_contents/render_view_host_manager.cc @@ -148,7 +148,7 @@ bool RenderViewHostManager::ShouldCloseTabOnUnresponsiveRenderer() { // handler later finishes, this call will be ignored because the state in // CrossSiteResourceHandler will already be cleaned up.) current_host()->process()->CrossSiteClosePageACK( - pending_render_view_host_->site_instance()->process_host_id(), + pending_render_view_host_->site_instance()->process_host_id(), pending_request_id); } return false; @@ -194,7 +194,7 @@ void RenderViewHostManager::OnCrossSiteResponse(int new_render_process_host_id, // means it is not a download or unsafe page, and we are going to perform the // navigation. Thus, we no longer need to remember that the RenderViewHost // is part of a pending cross-site request. - pending_render_view_host_->SetHasPendingCrossSiteRequest(false, + pending_render_view_host_->SetHasPendingCrossSiteRequest(false, new_request_id); } diff --git a/chrome/browser/tab_contents/repost_form_warning.h b/chrome/browser/tab_contents/repost_form_warning.h index 33588dc..9bbbbaa 100644 --- a/chrome/browser/tab_contents/repost_form_warning.h +++ b/chrome/browser/tab_contents/repost_form_warning.h @@ -1,17 +1,17 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_
-#define CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_
-
-class NavigationController;
-
-// Runs the form repost warning dialog. If the user accepts the action, then
-// it will call Reload on the navigation controller back with check_for_repost
-// set to false.
-//
-// This function is implemented by the platform-specific frontend.
-void RunRepostFormWarningDialog(NavigationController* nav_controller);
-
-#endif // CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_ +#define CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_ + +class NavigationController; + +// Runs the form repost warning dialog. If the user accepts the action, then +// it will call Reload on the navigation controller back with check_for_repost +// set to false. +// +// This function is implemented by the platform-specific frontend. +void RunRepostFormWarningDialog(NavigationController* nav_controller); + +#endif // CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_ diff --git a/chrome/browser/tab_contents/site_instance.h b/chrome/browser/tab_contents/site_instance.h index 141f61c..6e25a2b 100644 --- a/chrome/browser/tab_contents/site_instance.h +++ b/chrome/browser/tab_contents/site_instance.h @@ -109,7 +109,7 @@ class SiteInstance : public base::RefCounted<SiteInstance> { // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. // // The render process host factory may be NULL. See SiteInstance constructor. - // + // // TODO(creis): This may be an argument to build a pass_refptr<T> class, as // Darin suggests. static SiteInstance* CreateSiteInstance(Profile* profile); diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 1df337c..56db088 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -159,7 +159,7 @@ const string16& TabContents::GetTitle() const { NavigationEntry* entry = controller_->GetTransientEntry(); if (entry) return entry->GetTitleForDisplay(controller_); - + entry = controller_->GetLastCommittedEntry(); if (entry) return entry->GetTitleForDisplay(controller_); @@ -597,7 +597,7 @@ void TabContents::SetIsLoading(bool is_loading, NotificationDetails det = details ? Details<LoadNotificationDetails>(details) : NotificationService::NoDetails(); - NotificationService::current()->Notify(type, + NotificationService::current()->Notify(type, Source<NavigationController>(this->controller()), det); } diff --git a/chrome/browser/tab_contents/test_web_contents.cc b/chrome/browser/tab_contents/test_web_contents.cc index 866e28a..2977423 100644 --- a/chrome/browser/tab_contents/test_web_contents.cc +++ b/chrome/browser/tab_contents/test_web_contents.cc @@ -1,18 +1,18 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/tab_contents/test_web_contents.h"
-
-#include "chrome/browser/renderer_host/test_render_view_host.h"
-
-TestWebContents::TestWebContents(Profile* profile, SiteInstance* instance,
- RenderViewHostFactory* rvh_factory)
- : WebContents(profile, instance, rvh_factory, MSG_ROUTING_NONE, NULL),
- transition_cross_site(false) {
-}
-
-TestRenderViewHost* TestWebContents::pending_rvh() {
- return static_cast<TestRenderViewHost*>(
- render_manager_.pending_render_view_host_);
-}
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/tab_contents/test_web_contents.h" + +#include "chrome/browser/renderer_host/test_render_view_host.h" + +TestWebContents::TestWebContents(Profile* profile, SiteInstance* instance, + RenderViewHostFactory* rvh_factory) + : WebContents(profile, instance, rvh_factory, MSG_ROUTING_NONE, NULL), + transition_cross_site(false) { +} + +TestRenderViewHost* TestWebContents::pending_rvh() { + return static_cast<TestRenderViewHost*>( + render_manager_.pending_render_view_host_); +} diff --git a/chrome/browser/tab_contents/test_web_contents.h b/chrome/browser/tab_contents/test_web_contents.h index ba7fa33..42ba35e 100644 --- a/chrome/browser/tab_contents/test_web_contents.h +++ b/chrome/browser/tab_contents/test_web_contents.h @@ -1,55 +1,55 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
-#define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
-
-#include "chrome/browser/tab_contents/web_contents.h"
-
-class RenderViewHostFactory;
-class TestRenderViewHost;
-
-// Subclass WebContents to ensure it creates TestRenderViewHosts and does
-// not do anything involving views.
-class TestWebContents : public WebContents {
- public:
- // The render view host factory will be passed on to the
- TestWebContents(Profile* profile, SiteInstance* instance,
- RenderViewHostFactory* rvh_factory);
-
- TestRenderViewHost* pending_rvh();
-
- // State accessor.
- bool cross_navigation_pending() {
- return render_manager_.cross_navigation_pending_;
- }
-
- // Overrides WebContents::ShouldTransitionCrossSite so that we can test both
- // alternatives without using command-line switches.
- bool ShouldTransitionCrossSite() { return transition_cross_site; }
-
- // Promote DidNavigate to public.
- void TestDidNavigate(RenderViewHost* render_view_host,
- const ViewHostMsg_FrameNavigate_Params& params) {
- DidNavigate(render_view_host, params);
- }
-
- // Promote GetWebkitPrefs to public.
- WebPreferences TestGetWebkitPrefs() {
- return GetWebkitPrefs();
- }
-
- // Prevent interaction with views.
- bool CreateRenderViewForRenderManager(RenderViewHost* render_view_host) {
- // This will go to a TestRenderViewHost.
- render_view_host->CreateRenderView();
- return true;
- }
- void UpdateRenderViewSizeForRenderManager() {}
-
- // Set by individual tests.
- bool transition_cross_site;
-};
-
-#endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ +#define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ + +#include "chrome/browser/tab_contents/web_contents.h" + +class RenderViewHostFactory; +class TestRenderViewHost; + +// Subclass WebContents to ensure it creates TestRenderViewHosts and does +// not do anything involving views. +class TestWebContents : public WebContents { + public: + // The render view host factory will be passed on to the + TestWebContents(Profile* profile, SiteInstance* instance, + RenderViewHostFactory* rvh_factory); + + TestRenderViewHost* pending_rvh(); + + // State accessor. + bool cross_navigation_pending() { + return render_manager_.cross_navigation_pending_; + } + + // Overrides WebContents::ShouldTransitionCrossSite so that we can test both + // alternatives without using command-line switches. + bool ShouldTransitionCrossSite() { return transition_cross_site; } + + // Promote DidNavigate to public. + void TestDidNavigate(RenderViewHost* render_view_host, + const ViewHostMsg_FrameNavigate_Params& params) { + DidNavigate(render_view_host, params); + } + + // Promote GetWebkitPrefs to public. + WebPreferences TestGetWebkitPrefs() { + return GetWebkitPrefs(); + } + + // Prevent interaction with views. + bool CreateRenderViewForRenderManager(RenderViewHost* render_view_host) { + // This will go to a TestRenderViewHost. + render_view_host->CreateRenderView(); + return true; + } + void UpdateRenderViewSizeForRenderManager() {} + + // Set by individual tests. + bool transition_cross_site; +}; + +#endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index dd2820b..6ca0726 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -1468,7 +1468,7 @@ WebContents::GetLastCommittedNavigationEntryForRenderManager() { return NULL; return controller()->GetLastCommittedEntry(); } - + bool WebContents::CreateRenderViewForRenderManager( RenderViewHost* render_view_host) { RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index a25c589..134b43a 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -149,7 +149,7 @@ class TestInterstitialPage : public InterstitialPage { SiteInstance::CreateSiteInstance(tab()->profile()), this, MSG_ROUTING_NONE, NULL); } - + virtual void CommandReceived(const std::string& command) { command_received_count_++; } @@ -973,10 +973,10 @@ TEST_F(WebContentsTest, ShowInterstitialOnInterstitial) { // Showing interstitial2 should have caused interstitial1 to go away. EXPECT_TRUE(deleted1); EXPECT_EQ(TestInterstitialPage::CANCELED, state1); - + // Let's make sure interstitial2 is working as intended. ASSERT_FALSE(deleted2); - EXPECT_EQ(TestInterstitialPage::UNDECIDED, state2); + EXPECT_EQ(TestInterstitialPage::UNDECIDED, state2); interstitial2->Proceed(); GURL landing_url("http://www.thepage.com"); rvh()->SendNavigate(2, landing_url); diff --git a/chrome/browser/tab_contents/web_contents_view_mac.mm b/chrome/browser/tab_contents/web_contents_view_mac.mm index a382bca..acdf717 100644 --- a/chrome/browser/tab_contents/web_contents_view_mac.mm +++ b/chrome/browser/tab_contents/web_contents_view_mac.mm @@ -47,14 +47,14 @@ RenderWidgetHostView* WebContentsViewMac::CreateViewForWidget( DCHECK(!render_widget_host->view()); RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(render_widget_host); - + // Fancy layout comes later; for now just make it our size and resize it // with us. NSView* view_view = view->native_view(); [cocoa_view_.get() addSubview:view_view]; [view_view setFrame:[cocoa_view_.get() bounds]]; [view_view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - + return view; } @@ -107,7 +107,7 @@ void WebContentsViewMac::ForwardMessageToDevToolsClient( const IPC::Message& message) { NOTIMPLEMENTED(); } - + void WebContentsViewMac::FindInPage(const Browser& browser, bool find_next, bool forward_direction) { if (!find_bar_.get()) { @@ -228,7 +228,7 @@ void WebContentsViewMac::Observe(NotificationType type, CFRetain(view); [view release]; sad_tab_.reset(view); - + // Set as the dominant child. [cocoa_view_.get() addSubview:view]; [view setFrame:[cocoa_view_.get() bounds]]; diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index ae17dbe..870b461 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -154,7 +154,7 @@ std::wstring TaskManagerTableModel::GetText(int row, int col_id) { if (!first_in_group) return std::wstring(); return IntToWString(base::GetProcId(resource->GetProcess())); - + case kGoatsTeleportedColumn: // Goats Teleported. goats_teleported_ += rand(); return FormatNumber(goats_teleported_); @@ -264,7 +264,7 @@ HANDLE TaskManagerTableModel::GetProcessAt(int index) { void TaskManagerTableModel::StartUpdating() { DCHECK_NE(TASK_PENDING, update_state_); - + // If update_state_ is STOPPING, it means a task is still pending. Setting // it to TASK_PENDING ensures the tasks keep being posted (by Refresh()). if (update_state_ == IDLE) { @@ -546,7 +546,7 @@ int TaskManagerTableModel::CompareValues(int row1, int row2, int column_id) { int proc2_id = base::GetProcId(resources_[row2]->GetProcess()); return ValueCompare<int>(proc1_id, proc2_id); } - + case kGoatsTeleportedColumn: return 0; // Don't bother, numbers are random. @@ -846,7 +846,7 @@ void TaskManagerContents::Layout() { y() + kPanelVertMargin, width() - 2 * kPanelHorizMargin, height() - 2 * kPanelVertMargin - prefered_height); - + // y-coordinate of button top left. gfx::Rect parent_bounds = GetParent()->GetLocalBounds(false); int y_buttons = parent_bounds.bottom() - prefered_height - kButtonVEdgeMargin; diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc index 08dc00b..803fa69 100644 --- a/chrome/browser/toolbar_model.cc +++ b/chrome/browser/toolbar_model.cc @@ -127,7 +127,7 @@ void ToolbarModel::GetIconHoverText(std::wstring* text, SkColor* text_color) { NavigationEntry* entry = navigation_controller->GetActiveEntry(); DCHECK(entry); - + const NavigationEntry::SSLStatus& ssl = entry->ssl(); switch (ssl.security_style()) { case SECURITY_STYLE_AUTHENTICATED: { diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc index 3089e82..74990d3 100644 --- a/chrome/browser/unload_uitest.cc +++ b/chrome/browser/unload_uitest.cc @@ -127,7 +127,7 @@ class UnloadTest : public UITest { CheckTitle(L"Title Of Awesomeness"); } - + void LoadUrlAndQuitBrowser(const std::string& html_content, const std::wstring& expected_title = L"") { scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); @@ -164,7 +164,7 @@ TEST_F(UnloadTest, CrossSiteInfiniteUnloadAsync) { // Navigate to a page with an infinite unload handler. // Then two two sync crosssite requests to ensure -// we correctly nav to each one. +// we correctly nav to each one. TEST_F(UnloadTest, CrossSiteInfiniteUnloadSync) { // Tests makes no sense in single-process mode since the renderer is hung. if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) @@ -192,7 +192,7 @@ TEST_F(UnloadTest, CrossSiteInfiniteBeforeUnloadAsync) { // Navigate to a page with an infinite beforeunload handler. // Then two two sync crosssite requests to ensure -// we correctly nav to each one. +// we correctly nav to each one. TEST_F(UnloadTest, CrossSiteInfiniteBeforeUnloadSync) { // Tests makes no sense in single-process mode since the renderer is hung. if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) @@ -288,4 +288,4 @@ TEST_F(UnloadTest, BrowserCloseTwoSecondBeforeUnloadAlert) { } // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs -// and multiple windows.
\ No newline at end of file +// and multiple windows. diff --git a/chrome/browser/views/about_ipc_dialog.cc b/chrome/browser/views/about_ipc_dialog.cc index 6c60840..4abc588 100644 --- a/chrome/browser/views/about_ipc_dialog.cc +++ b/chrome/browser/views/about_ipc_dialog.cc @@ -436,4 +436,4 @@ void AboutIPCDialog::ButtonPressed(views::BaseButton* button) { } } -#endif // IPC_MESSAGE_LOG_ENABLED
\ No newline at end of file +#endif // IPC_MESSAGE_LOG_ENABLED diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc index c62b175..2a4740f 100644 --- a/chrome/browser/views/bookmark_bar_view_test.cc +++ b/chrome/browser/views/bookmark_bar_view_test.cc @@ -36,7 +36,7 @@ class TestingPageNavigator : public PageNavigator { // Base class for event generating bookmark view tests. These test are intended // to exercise ChromeMenus, but that's easier done with BookmarkBarView rather // than ChromeMenu itself. -// +// // SetUp creates a bookmark model with the following structure. // All folders are in upper case, all URLs in lower case. // F1 @@ -939,7 +939,7 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { ASSERT_TRUE(child_menu != NULL); ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, NULL); - + // Delay until we send tab, otherwise the message box doesn't appear // correctly. MessageLoop::current()->PostDelayedTask(FROM_HERE, diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc index c0fe27a..dc4bf29 100644 --- a/chrome/browser/views/bookmark_bubble_view.cc +++ b/chrome/browser/views/bookmark_bubble_view.cc @@ -233,7 +233,7 @@ void BookmarkBubbleView::Init() { cs->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); cs->AddPaddingColumn(1, kUnrelatedControlHorizontalSpacing); - cs->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, GridLayout::USE_PREF, + cs->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); // Middle (input field) rows. @@ -291,7 +291,7 @@ std::wstring BookmarkBubbleView::GetTitle() { return std::wstring(); } -void BookmarkBubbleView::ButtonPressed(views::NativeButton* sender) { +void BookmarkBubbleView::ButtonPressed(views::NativeButton* sender) { if (sender == edit_button_) { UserMetrics::RecordAction(L"BookmarkBubble_Edit", profile_); ShowEditor(); @@ -299,7 +299,7 @@ void BookmarkBubbleView::ButtonPressed(views::NativeButton* sender) { DCHECK(sender == close_button_); Close(); } - // WARNING: we've most likely been deleted when CloseWindow returns. + // WARNING: we've most likely been deleted when CloseWindow returns. } void BookmarkBubbleView::LinkActivated(Link* source, int event_flags) { diff --git a/chrome/browser/views/bookmark_bubble_view.h b/chrome/browser/views/bookmark_bubble_view.h index 2f0f7c1..31c8c8c 100644 --- a/chrome/browser/views/bookmark_bubble_view.h +++ b/chrome/browser/views/bookmark_bubble_view.h @@ -101,7 +101,7 @@ class BookmarkBubbleView : public views::View, // editor (depending upon which link was clicked). virtual void LinkActivated(views::Link* source, int event_flags); - // ButtonListener method, closes the bubble or opens the edit dialog. + // ButtonListener method, closes the bubble or opens the edit dialog. virtual void ButtonPressed(views::NativeButton* sender); // ComboBox::Listener method. Changes the parent of the bookmark. diff --git a/chrome/browser/views/bookmark_table_view.cc b/chrome/browser/views/bookmark_table_view.cc index 6e5bada..bbd0731 100644 --- a/chrome/browser/views/bookmark_table_view.cc +++ b/chrome/browser/views/bookmark_table_view.cc @@ -433,7 +433,7 @@ void BookmarkTableView::PaintAltText() { 1, bounds.width() - 2, bounds.height() - 2, ChromeCanvas::TEXT_ALIGN_LEFT); canvas.getTopPlatformDevice().drawToHDC(dc, bounds.x(), bounds.y(), NULL); - ReleaseDC(GetNativeControlHWND(), dc); + ReleaseDC(GetNativeControlHWND(), dc); } gfx::Rect BookmarkTableView::GetAltTextBounds() { diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index 350e5f6..8b08a3f 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -207,7 +207,7 @@ DownloadItemView::DownloadItemView(DownloadItem* download, // Extract the file extension (if any). std::wstring extension = file_util::GetFileExtensionFromPath(file_name); - std::wstring rootname = + std::wstring rootname = file_util::GetFilenameWithoutExtensionFromPath(file_name); // Elide giant extensions (this shouldn't currently be hit, but might @@ -217,7 +217,7 @@ DownloadItemView::DownloadItemView(DownloadItem* download, ElideString(rootname, kFileNameMaxLength - extension.length(), &rootname); dangerous_download_label_ = new views::Label( - l10n_util::GetStringF(IDS_PROMPT_DANGEROUS_DOWNLOAD, + l10n_util::GetStringF(IDS_PROMPT_DANGEROUS_DOWNLOAD, rootname + L"." + extension)); dangerous_download_label_->SetMultiLine(true); dangerous_download_label_->SetHorizontalAlignment( @@ -456,7 +456,7 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) { // Last value of x was the end of the right image, just before the button. // Note that in dangerous mode we use a label (as the text is multi-line). if (!IsDangerousMode()) { - std::wstring filename = + std::wstring filename = gfx::ElideFilename(download_->GetFileName().ToWStringHack(), font_, kTextWidth); diff --git a/chrome/browser/views/edit_keyword_controller.cc b/chrome/browser/views/edit_keyword_controller.cc index 11d7571..7e01074 100644 --- a/chrome/browser/views/edit_keyword_controller.cc +++ b/chrome/browser/views/edit_keyword_controller.cc @@ -53,7 +53,7 @@ void EditKeywordController::Show() { // Window interprets an empty rectangle as needing to query the content for // the size as well as centering relative to the parent. views::Window::CreateChromeWindow(::IsWindow(parent_) ? parent_ : NULL, - gfx::Rect(), this); + gfx::Rect(), this); window()->Show(); GetDialogClientView()->UpdateDialogButtons(); title_tf_->SelectAll(); diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc index 79fa9c0..1ed7916 100644 --- a/chrome/browser/views/first_run_bubble.cc +++ b/chrome/browser/views/first_run_bubble.cc @@ -120,7 +120,7 @@ class FirstRunBubbleView : public views::View, gfx::Size pref_size = label1_->GetPreferredSize(); label1_->SetMultiLine(true); label1_->SizeToFit(canvas.width() - kBubblePadding * 2); - label1_->SetBounds(kBubblePadding, kBubblePadding, + label1_->SetBounds(kBubblePadding, kBubblePadding, canvas.width() - kBubblePadding * 2, pref_size.height()); diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc index 274f561..55e8d5b 100644 --- a/chrome/browser/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/views/frame/glass_browser_frame_view.cc @@ -164,7 +164,7 @@ gfx::Rect GlassBrowserFrameView::GetWindowBoundsForClientBounds( RECT rect = client_bounds.ToRECT(); AdjustWindowRectEx(&rect, frame_->window_style(), FALSE, frame_->window_ex_style()); - return gfx::Rect(rect); + return gfx::Rect(rect); } int top_height = NonClientTopBorderHeight(); @@ -296,7 +296,7 @@ void GlassBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) { SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon(); canvas->DrawBitmapInt(otr_avatar_icon, 0, (otr_avatar_icon.height() - otr_avatar_bounds_.height()) / 2, - otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), + otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), MirroredLeftPointForRect(otr_avatar_bounds_), otr_avatar_bounds_.y(), otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false); } diff --git a/chrome/browser/views/frame/glass_browser_frame_view.h b/chrome/browser/views/frame/glass_browser_frame_view.h index edaed89..f6e3aff 100644 --- a/chrome/browser/views/frame/glass_browser_frame_view.h +++ b/chrome/browser/views/frame/glass_browser_frame_view.h @@ -63,7 +63,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView { // Returns the bounds of the client area for the specified view size. gfx::Rect CalculateClientAreaBounds(int width, int height) const; - + // Starts/Stops the window throbber running. void StartThrobber(); void StopThrobber(); diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 39ba2d0..8452a37 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -167,7 +167,7 @@ class OTRActiveWindowResources : public views::WindowResources { virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } - + private: static void InitClass() { static bool initialized = false; @@ -842,7 +842,7 @@ void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) { SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon(); canvas->DrawBitmapInt(otr_avatar_icon, 0, (otr_avatar_icon.height() - otr_avatar_bounds_.height()) / 2, - otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), + otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), MirroredLeftPointForRect(otr_avatar_bounds_), otr_avatar_bounds_.y(), otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false); } diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h index f25e4f4..e21ff3d 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/views/frame/opaque_browser_frame_view.h @@ -115,7 +115,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, return frame_->is_active() || paint_as_active() ? current_active_resources_ : current_inactive_resources_; } - + // The layout rect of the title, if visible. gfx::Rect title_bounds_; diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index 590e8a8..72179ea 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -130,7 +130,7 @@ class HungRendererWarningView : public views::View, virtual views::View* GetExtraView(); virtual bool Accept(bool window_closing); virtual views::View* GetContentsView(); - + // views::NativeButton::Listener overrides: virtual void ButtonPressed(views::NativeButton* sender); @@ -379,7 +379,7 @@ void HungRendererWarningView::CreateKillButtonView() { kill_button_->SetListener(this); kill_button_container_ = new ButtonContainer; - + using views::GridLayout; using views::ColumnSet; diff --git a/chrome/browser/views/hwnd_html_view.h b/chrome/browser/views/hwnd_html_view.h index 67952a2..6f57ea3 100644 --- a/chrome/browser/views/hwnd_html_view.h +++ b/chrome/browser/views/hwnd_html_view.h @@ -49,7 +49,7 @@ class HWNDHtmlView : public views::HWNDView { // Our HTML rendering component. RenderViewHost* render_view_host_; - + // Whether or not the rendered content is permitted to send messages back to // the view, through |delegate_| via ProcessDOMUIMessage. bool allow_dom_ui_bindings_; diff --git a/chrome/browser/views/importer_view.cc b/chrome/browser/views/importer_view.cc index e7bd61c..def2826 100644 --- a/chrome/browser/views/importer_view.cc +++ b/chrome/browser/views/importer_view.cc @@ -154,27 +154,27 @@ std::wstring ImporterView::GetItemAt(views::ComboBox* source, int index) { return importer_host_->GetSourceProfileNameAt(index); } -void ImporterView::ItemChanged(views::ComboBox* combo_box, +void ImporterView::ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index) { DCHECK(combo_box); - DCHECK(checkbox_items_.size() >= - static_cast<size_t>(importer_host_->GetAvailableProfileCount())); - - if (prev_index == new_index) + DCHECK(checkbox_items_.size() >= + static_cast<size_t>(importer_host_->GetAvailableProfileCount())); + + if (prev_index == new_index) return; - + // Save the current state uint16 prev_items = GetCheckedItems(); checkbox_items_[prev_index] = prev_items; - + // Enable/Disable the checkboxes for this Item uint16 new_enabled_items = importer_host_->GetSourceProfileInfoAt( new_index).services_supported; - SetCheckedItemsState(new_enabled_items); - - // Set the checked items for this Item + SetCheckedItemsState(new_enabled_items); + + // Set the checked items for this Item uint16 new_items = checkbox_items_[new_index]; - SetCheckedItems(new_items); + SetCheckedItems(new_items); } void ImporterView::ImportCanceled() { @@ -204,7 +204,7 @@ uint16 ImporterView::GetCheckedItems() { if (search_engines_checkbox_->IsEnabled() && search_engines_checkbox_->IsSelected()) items |= SEARCH_ENGINES; - return items; + return items; } void ImporterView::SetCheckedItemsState(uint16 items) { @@ -242,7 +242,7 @@ void ImporterView::SetCheckedItems(uint16 items) { history_checkbox_->SetIsSelected(false); } } - + if (favorites_checkbox_->IsEnabled()) { if (items & FAVORITES) { favorites_checkbox_->SetIsSelected(true); @@ -250,7 +250,7 @@ void ImporterView::SetCheckedItems(uint16 items) { favorites_checkbox_->SetIsSelected(false); } } - + if (passwords_checkbox_->IsEnabled()) { if (items & PASSWORDS) { passwords_checkbox_->SetIsSelected(true); @@ -258,7 +258,7 @@ void ImporterView::SetCheckedItems(uint16 items) { passwords_checkbox_->SetIsSelected(false); } } - + if (search_engines_checkbox_->IsEnabled()) { if (items & SEARCH_ENGINES) { search_engines_checkbox_->SetIsSelected(true); diff --git a/chrome/browser/views/importer_view.h b/chrome/browser/views/importer_view.h index fa97e99..4f6efec 100644 --- a/chrome/browser/views/importer_view.h +++ b/chrome/browser/views/importer_view.h @@ -48,8 +48,8 @@ class ImporterView : public views::View, virtual std::wstring GetItemAt(views::ComboBox* source, int index); // Overridden from ChromeViews::ComboBox::Listener - virtual void ItemChanged(views::ComboBox* combo_box, - int prev_index, + virtual void ItemChanged(views::ComboBox* combo_box, + int prev_index, int new_index); // Overridden from ImportObserver: @@ -65,10 +65,10 @@ class ImporterView : public views::View, // Create a bitmap from the checkboxes of the view. uint16 GetCheckedItems(); - + // Enables/Disables all the checked items for the given state void SetCheckedItemsState(uint16 items); - + // Sets all checked items in the given state void SetCheckedItems(uint16 items); @@ -82,7 +82,7 @@ class ImporterView : public views::View, scoped_refptr<ImporterHost> importer_host_; - // Stores the state of the checked items associated with the position of the + // Stores the state of the checked items associated with the position of the // selected item in the combo-box. std::vector<uint16> checkbox_items_; diff --git a/chrome/browser/views/importing_progress_view.cc b/chrome/browser/views/importing_progress_view.cc index b87819a..82c8047 100644 --- a/chrome/browser/views/importing_progress_view.cc +++ b/chrome/browser/views/importing_progress_view.cc @@ -307,7 +307,7 @@ void StartImportingWithUI(HWND parent_window, // still need it to exist. No user interaction will be required. if (!coordinator->is_headless()) window->Show(); - + coordinator->StartImportSettings(source_profile, items, new ProfileWriter(target_profile), first_run); diff --git a/chrome/browser/views/infobars/infobar_container.h b/chrome/browser/views/infobars/infobar_container.h index 181d95e..dba3149 100644 --- a/chrome/browser/views/infobars/infobar_container.h +++ b/chrome/browser/views/infobars/infobar_container.h @@ -40,7 +40,7 @@ class InfoBarContainer : public views::View, virtual void ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child); - + private: // Overridden from NotificationObserver: virtual void Observe(NotificationType type, diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index aa60a6b..da3af20 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -214,7 +214,7 @@ void InfoBar::DestroyFocusTracker(bool restore_focus) { focus_tracker_->FocusLastFocusedExternalView(); focus_tracker_->SetFocusManager(NULL); focus_tracker_.reset(NULL); - } + } } void InfoBar::DeleteSelf() { diff --git a/chrome/browser/views/infobars/infobars.h b/chrome/browser/views/infobars/infobars.h index 56f140b..15885ce 100644 --- a/chrome/browser/views/infobars/infobars.h +++ b/chrome/browser/views/infobars/infobars.h @@ -45,7 +45,7 @@ class InfoBar : public views::View, // Starts animating the InfoBar closed. It will not be closed until the // animation has completed, when |Close| will be called. void AnimateClose(); - + // Closes the InfoBar immediately and removes it from its container. Notifies // the delegate that it has closed. The InfoBar is deleted after this function // is called. diff --git a/chrome/browser/views/keyword_editor_view.cc b/chrome/browser/views/keyword_editor_view.cc index c1442f0..f103e0a 100644 --- a/chrome/browser/views/keyword_editor_view.cc +++ b/chrome/browser/views/keyword_editor_view.cc @@ -437,18 +437,18 @@ gfx::Size KeywordEditorView::GetPreferredSize() { bool KeywordEditorView::CanResize() const { return true; } - + std::wstring KeywordEditorView::GetWindowTitle() const { return l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_WINDOW_TITLE); -} +} int KeywordEditorView::GetDialogButtons() const { return DIALOGBUTTON_CANCEL; } - + bool KeywordEditorView::Accept() { open_window = NULL; - return true; + return true; } bool KeywordEditorView::Cancel() { diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index 4323454..e6b1764 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -205,7 +205,7 @@ class LocationBarView : public LocationBar, // The minimum size is just big enough to show the tab. virtual gfx::Size GetMinimumSize(); virtual void Layout(); - + void set_profile(Profile* profile) { profile_ = profile; } private: diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc index e4380a1f5..594e5e2 100644 --- a/chrome/browser/views/options/cookies_view.cc +++ b/chrome/browser/views/options/cookies_view.cc @@ -302,7 +302,7 @@ void CookiesTableView::RemoveSelectedCookies() { // Select the next row after the last row deleted (unless removing last row). DCHECK(RowCount() > 0 && last_selected_view_row != -1); - Select(view_to_model(std::min(RowCount() - 1, + Select(view_to_model(std::min(RowCount() - 1, last_selected_view_row - remove_count + 1))); } diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index be7e81f..f0ac54c 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -464,7 +464,7 @@ LanguagesPageView::LanguagesPageView(Profile* profile) starting_ui_language_index_(-1) { accept_languages_.Init(prefs::kAcceptLanguages, profile->GetPrefs(), NULL); - enable_spellcheck_.Init(prefs::kEnableSpellCheck, + enable_spellcheck_.Init(prefs::kEnableSpellCheck, profile->GetPrefs(), NULL); } @@ -607,7 +607,7 @@ void LanguagesPageView::InitControlLayout() { dictionary_language_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CHROME_DICTIONARY_LANGUAGE)); dictionary_language_label_->SetHorizontalAlignment( - views::Label::ALIGN_LEFT); + views::Label::ALIGN_LEFT); enable_spellchecking_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_ENABLE_SPELLCHECK)); enable_spellchecking_checkbox_->SetListener(this); diff --git a/chrome/browser/views/options/languages_page_view.h b/chrome/browser/views/options/languages_page_view.h index d22a945..e79a4ab 100644 --- a/chrome/browser/views/options/languages_page_view.h +++ b/chrome/browser/views/options/languages_page_view.h @@ -93,10 +93,10 @@ class LanguagesPageView : public OptionsPageView, // The contents of the "dictionary language" combobox. scoped_ptr<LanguageComboboxModel> dictionary_language_model_; StringPrefMember dictionary_language_; - + // SpellChecker enable pref. BooleanPrefMember enable_spellcheck_; - + // This is assigned the new index of spellcheck language if the language // is changed. Otherwise, it remains -1, and pref members are not updated. int spellcheck_language_index_selected_; diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window.cc index 418d31e..510784f 100644 --- a/chrome/browser/views/page_info_window.cc +++ b/chrome/browser/views/page_info_window.cc @@ -565,7 +565,7 @@ void PageInfoWindow::Init(Profile* profile, views::Window::CreateChromeWindow(parent, gfx::Rect(), this); // TODO(beng): (Cleanup) - cert viewer button should use GetExtraView. - + if (cert_id_) { scoped_refptr<net::X509Certificate> cert; CertStore::GetSharedInstance()->RetrieveCert(cert_id_, &cert); @@ -663,13 +663,13 @@ void PageInfoWindow::ShowCertDialog(int cert_id) { if (!cert.get()) { // The certificate was not found. Could be that the renderer crashed before // we displayed the page info. - return; - } + return; + } - CRYPTUI_VIEWCERTIFICATE_STRUCT view_info = { 0 }; - view_info.dwSize = sizeof(view_info); - // We set our parent to the tab window. This makes the cert dialog created - // in CryptUIDlgViewCertificate modal to the browser. + CRYPTUI_VIEWCERTIFICATE_STRUCT view_info = { 0 }; + view_info.dwSize = sizeof(view_info); + // We set our parent to the tab window. This makes the cert dialog created + // in CryptUIDlgViewCertificate modal to the browser. view_info.hwndParent = window()->owning_window(); view_info.dwFlags = CRYPTUI_DISABLE_EDITPROPERTIES | CRYPTUI_DISABLE_ADDTOSTORE; diff --git a/chrome/browser/views/password_manager_view.h b/chrome/browser/views/password_manager_view.h index a43b9f3..a5e5950 100644 --- a/chrome/browser/views/password_manager_view.h +++ b/chrome/browser/views/password_manager_view.h @@ -57,7 +57,7 @@ class PasswordManagerTableModel : public views::TableModel, : display_url(url), form(password_form) { } - // Contains the URL that is displayed along with the + // Contains the URL that is displayed along with the gfx::SortedDisplayURL display_url; // The underlying PasswordForm. We own this. diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc index ed50ca7..a883ad5 100644 --- a/chrome/browser/views/shell_dialogs_win.cc +++ b/chrome/browser/views/shell_dialogs_win.cc @@ -375,13 +375,13 @@ bool SelectFileDialogImpl::RunSelectFolderDialog(const std::wstring& title, browse_info.lpszTitle = title.c_str(); browse_info.pszDisplayName = dir_buffer; browse_info.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS; - + if (path->length()) { // Highlight the current value. browse_info.lParam = (LPARAM)path->c_str(); browse_info.lpfn = &BrowseCallbackProc; } - + LPITEMIDLIST list = SHBrowseForFolder(&browse_info); DisableOwner(owner); if (list) { diff --git a/chrome/browser/views/tabs/tab_dragging_test.cc b/chrome/browser/views/tabs/tab_dragging_test.cc index a136046..76a6574b 100644 --- a/chrome/browser/views/tabs/tab_dragging_test.cc +++ b/chrome/browser/views/tabs/tab_dragging_test.cc @@ -50,7 +50,7 @@ TEST_F(TabDraggingTest, Tab1Tab2) { ASSERT_TRUE(browser->AppendTab(tab2_url)); scoped_ptr<TabProxy> tab2(browser->GetTab(1)); ASSERT_TRUE(tab2.get()); - + // Add Tab_3. GURL tab3_url("about:plugins"); ASSERT_TRUE(browser->AppendTab(tab3_url)); @@ -100,8 +100,8 @@ TEST_F(TabDraggingTest, Tab1Tab2) { // | Tab_1 | Tab_2 | Tab_3 | // ---- ---- ---- ---- ---- ---- ---- ---- ---- // x---- ----> - // ____________ - // / X \ + // ____________ + // / X \ // | Tab_1 | // ---- ---- ---- @@ -130,7 +130,7 @@ TEST_F(TabDraggingTest, Tab1Tab2) { EXPECT_EQ(tab2_url.spec(), tab1_new_url.spec()); } -// Drag Tab_1 into the position of Tab_3. +// Drag Tab_1 into the position of Tab_3. TEST_F(TabDraggingTest, Tab1Tab3) { scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); @@ -153,7 +153,7 @@ TEST_F(TabDraggingTest, Tab1Tab3) { ASSERT_TRUE(browser->AppendTab(tab2_url)); scoped_ptr<TabProxy> tab2(browser->GetTab(1)); ASSERT_TRUE(tab2.get()); - + // Add Tab_3. GURL tab3_url("about:plugins"); ASSERT_TRUE(browser->AppendTab(tab3_url)); @@ -203,13 +203,13 @@ TEST_F(TabDraggingTest, Tab1Tab3) { // | Tab_1 | Tab_2 | Tab_3 | // ---- ---- ---- ---- ---- ---- ---- ---- ---- // x---- ---- ---- ---- ---- ----> - // ____________ - // / X \ + // ____________ + // / X \ // | Tab_1 | // ---- ---- ---- POINT start; - POINT end; + POINT end; start.x = bounds1.x() + bounds1.width()/2; start.y = bounds1.y() + bounds1.height()/2; end.x = start.x + bounds1.width()/2 + bounds2.width() + bounds3.width()/2; @@ -263,7 +263,7 @@ TEST_F(TabDraggingTest, Tab1Tab3Escape) { ASSERT_TRUE(browser->AppendTab(tab2_url)); scoped_ptr<TabProxy> tab2(browser->GetTab(1)); ASSERT_TRUE(tab2.get()); - + // Add Tab_3. GURL tab3_url("about:plugins"); ASSERT_TRUE(browser->AppendTab(tab3_url)); @@ -313,19 +313,19 @@ TEST_F(TabDraggingTest, Tab1Tab3Escape) { // | Tab_1 | Tab_2 | Tab_3 | // ---- ---- ---- ---- ---- ---- ---- ---- ---- // x---- ---- ---- ---- ---- ----> + ESCAPE - // ____________ - // / X \ + // ____________ + // / X \ // | Tab_1 | // ---- ---- ---- POINT start; - POINT end; + POINT end; start.x = bounds1.x() + bounds1.width()/2; start.y = bounds1.y() + bounds1.height()/2; end.x = start.x + bounds1.width()/2 + bounds2.width() + bounds3.width()/2; end.y = start.y; - // Simulate drag with 'true' as the last parameter. This will interrupt + // Simulate drag with 'true' as the last parameter. This will interrupt // in-flight with Escape. ASSERT_TRUE(browser->SimulateDrag(start, end, views::Event::EF_LEFT_BUTTON_DOWN, @@ -346,7 +346,7 @@ TEST_F(TabDraggingTest, Tab1Tab3Escape) { ASSERT_TRUE(tab3.get()); GURL tab3_new_url; ASSERT_TRUE(tab3->GetCurrentURL(&tab3_new_url)); - + // The tabs should be in their original positions. EXPECT_EQ(tab1_new_url.spec(), tab1_url.spec()); EXPECT_EQ(tab2_new_url.spec(), tab2_url.spec()); @@ -376,7 +376,7 @@ TEST_F(TabDraggingTest, Tab2OutOfTabStrip) { ASSERT_TRUE(browser->AppendTab(tab2_url)); scoped_ptr<TabProxy> tab2(browser->GetTab(1)); ASSERT_TRUE(tab2.get()); - + // Add Tab_3. GURL tab3_url("about:plugins"); ASSERT_TRUE(browser->AppendTab(tab3_url)); @@ -435,17 +435,17 @@ TEST_F(TabDraggingTest, Tab2OutOfTabStrip) { // / \ / \ / \ // | Tab_1 | Tab_2 | Tab_3 | // ---- ---- ---- ---- ---- ---- ---- ---- ---- - // x - // | + // x + // | // | (Drag this below, out of tab strip) - // V - // ____________ - // / X \ + // V + // ____________ + // / X \ // | Tab_2 | (New Window) // ---- ---- ---- ---- ---- ---- ---- POINT start; - POINT end; + POINT end; start.x = bounds2.x() + bounds2.width()/2; start.y = bounds2.y() + bounds2.height()/2; end.x = start.x; @@ -471,8 +471,8 @@ TEST_F(TabDraggingTest, Tab2OutOfTabStrip) { ASSERT_TRUE(tab2.get()); GURL tab2_new_url; ASSERT_TRUE(tab2->GetCurrentURL(&tab2_new_url)); - - // Now check for proper shifting of tabs; i.e., Tab_3 in window 1 should + + // Now check for proper shifting of tabs; i.e., Tab_3 in window 1 should // shift left to the position of Tab_2; Tab_1 should stay where it was. EXPECT_EQ(tab1_new_url.spec(), tab1_url.spec()); EXPECT_EQ(tab2_new_url.spec(), tab3_url.spec()); diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index f060135..c5e16b4 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -808,7 +808,7 @@ void BrowserToolbarView::ButtonPressed(views::BaseButton* sender) { // static int BrowserToolbarView::PopupTopSpacing() { - return GetWidget()->AsWindow()->UseNativeFrame() ? 0 + return GetWidget()->AsWindow()->UseNativeFrame() ? 0 : kPopupTopSpacingNonGlass; } diff --git a/chrome/browser/visitedlink_unittest.cc b/chrome/browser/visitedlink_unittest.cc index 5b3928a..c3cbd0a 100644 --- a/chrome/browser/visitedlink_unittest.cc +++ b/chrome/browser/visitedlink_unittest.cc @@ -144,7 +144,7 @@ class VisitedLinkTest : public testing::Test { ClearDB(); file_util::Delete(history_dir_, true); } - + MessageLoop message_loop_; // Filenames for the services; |