Fix a crash in downloads.acceptDanger()

On mac, when the ConstrainedWindow (DownloadDangerPrompt) stole key-ness from
the extension popup, the popup was automatically closing, which would
automatically close the DownloadDangerPrompt before the user could interact with
it.

Now when ExtensionPopupController receives a windowDidResignKey notification, it
drops the notification if there are any modal dialogs showing for its WebContents.
There's also an extra windowDidResignKey notification right after the modal
dialog closes, so ExtensionPopupController::windowDidResignKey() sets a flag to
ignore it.

TabModalConfirmDialogMac::OnConstrainedWindowClosed() could be called twice
causing double-deletes. Passing the delegate_ to a stack variable allows the
second call to return before double-deleting.

Add DownloadsAcceptDangerFunction::OnPromptCreatedForTesting(callback) so that
the browser test can fake the user clicking in the DownloadDangerPrompt.

Override ChromeWebModalDialogManagerDelegate::GetWebContentsModalDialogHost() in
ExtensionHost to return a valid WebContentsModalDialogHost (ExtensionDialogHost)
instead of NULL. This object is necessary in
CreateWebContentsModalDialogViews(). ExtensionHost outlives ExtensionDialogHost
which outlives the dialog.

BUG=273114

Review URL: https://chromiumcodereview.appspot.com/23064010

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219455 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix the problem that the active panel does not get focus on Mac

The problem is caused by our workaround to remove the web contents view and then put it back to solve the whitestrip issue for the title-only panel. We need to tell the render widget host view to accept the focus when the web contents view is added back.

BUG=277127
TEST=Manual test by creating a panel with initial focus

Review URL: https://chromiumcodereview.appspot.com/23075024

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219456 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Make local domain resolver send both ipv4 and ipv6 addresses

Make local domain resolver send both ipv4 and ipv6 addresses, and make
the asynchronous HTTP factory prefer ipv4 to ipv6.

BUG=

Review URL: https://chromiumcodereview.appspot.com/23171031

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219457 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix bug causing arg urls not to be saved in the fullstream policy.

BUG=278627

Review URL: https://chromiumcodereview.appspot.com/23286006

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219462 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Move DragDownload() out of download_util.h

With this change download_util.h is gone, the remained function is moved
into a new header file called drag_download_item.h.

Which makes more sense since the remained function is related to
drag and drop functionality.

- Renamed DragDownload() to DragDownloadItem().

BUG=104549
TEST=unit_tests
R=benjhayden@chromium.org,asanka@chromium.org
TBR=thestig

Review URL: https://chromiumcodereview.appspot.com/23271005

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219481 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add policy for fullscreen mode; disallow fullscreen in public sessions

This CL adds a user policy that determines whether fullscreen mode is
allowed and uses it to disallow fullscreen mode in public sessions.

BUG=275405
TEST=New browser tests

Review URL: https://chromiumcodereview.appspot.com/22986010

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219482 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add NavigationTimeKeeper to track network navigation times of navigation 
entries. History and session sync use NavigationTimeKeeper to obtain 
consistent network timestamps of navigations.

TBR=ben@chromium.org
BUG=265523

Review URL: https://chromiumcodereview.appspot.com/22981004

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219484 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
drive: Stop mentioning resource ID in FileCache

BUG=275270
TEST=unit_tests

Review URL: https://chromiumcodereview.appspot.com/23125019

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219493 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
file_manager: Split the open with browser stuff into a set of separate files

This is a reland of r219281, which was reverted for breaking the tree.

Yet another meaty stuff from the kitchen sink file file_manager_util.cc

BUG=270469
TEST=none
R=kinaba@chromium.org

Review URL: https://codereview.chromium.org/22886013

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219494 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
content: Move kHttpsScheme constant into content namespace.

BUG=None
TBR=jam@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23112033

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219495 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
SyncFS: Fix lint errors on local-side components


BUG=n/a
TEST=n/a
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/23273005

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219503 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
[Files.app] Prevent full-regenerate the list in NavigationList.

Previously, both this.volumesList_ and this.pinnedList_ were full-regenerated (creating all object on each refresh) then either model is refreshed.

This patch prevents the full-regeneration and keeps non-deleted items, so only new item created is created on refresh.

This patch shouldn't change no functionality, but improves performance.

BUG=none
TEST=Navigation list works.
R=hirono@chromium.org

Review URL: https://codereview.chromium.org/23070007

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219508 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
drive: Stop setting ResourceEntry::parent_local_id in ConvertToResourceEntry

Filling the field with a resource ID is quite wrong.
Add another output argument to ConvertToResourceEntry for parent resource ID.

BUG=260514
TEST=unit_tests
R=kinaba@chromium.org

Review URL: https://codereview.chromium.org/23308007

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219510 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix SearchOperationTest to use single change list loader thoroughout the test.

The CheckForUpdates() call rewritten in this CL was no-op,
because it's a newly created ChangeListLoader with is_loaded_ = false.
Clearly this is not what is intended in the test.

BUG=278139
R=hidehiko@chromium.org

Review URL: https://codereview.chromium.org/23418002

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219511 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Clean up Drive file system test.

* Added missing OVERRIDEs.
* Made FileSystemTest free from TestingProfile (which also leads to less dependency to file_system_util.h).
* Changed to check the result of SetUpTestFileSystem by ASSER_NO_FAITAL_FAILURE; otherwise, failures in SetUpResourceMetadataAndFileSystem were ignored.

BUG=none
R=hashimoto@chromium.org

Review URL: https://codereview.chromium.org/23409005

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219514 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Verify that no empty flags leak into the command line.

Also make this easier to spot in debug builds.

BUG=262975
TEST=unit_tests still pass.

Review URL: https://chromiumcodereview.appspot.com/21038005

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219518 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Send Chrome's process id to the app shim.

This saves the app shim from having to look it up using Chrome's bundle
id. This also allows the shim to connect to Chrome processes started by
tests which are not associated with the bundle.

BUG=168080

Review URL: https://chromiumcodereview.appspot.com/22903025

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219519 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Move OAuth2TokenService to google_apis/.

This is for removing the dependency from c/b/google_apis/ to
the chrome/ directory and move the whole directory content
to more componentized, top-level google_api/ directory.

As discussed in http://crbug.com/146989#c28 - #c30, OAuth2TokenSerive,
which is the last dependency, is in fact written sorely using
google_api/ items and hence itself can easily be moved to there.

BUG=264570, 146989

Review URL: https://chromiumcodereview.appspot.com/23202015

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219520 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Refactor GetFileRequest.

Renamed to FilesGetRequest to reflect the Drive API v2's method name.
Simplify ctor, and moved file_id to setter.
Moved request to google_apis::drive namespace.
Renamed GetFileUrl() to GetFilesGetUrl().
Renamed ParseResourceEntryAndRun() to ConvertFileResourceToResourceEntryAndRun().

BUG=275233, 277253
TEST=Ran unit_tests

Review URL: https://chromiumcodereview.appspot.com/23407003

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219521 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
file_manager: Introduce mime_util.h

Along the way, add tests for GetMimeTypesForPaths()

BUG=270469
TEST=none

Review URL: https://chromiumcodereview.appspot.com/22802022

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@219522 4ff67af0-8c30-449e-8e8b-ad334ec8d88c