Disable crashing ChromeOS unit_test MobileConfigTest.Basic.

Crashes began with unrelated http://crrev.com/174786
The underlying cause is unknown, see the bug for more information.

BUG=167926
TEST=Other MobileConfigTest tests pass; tree greens up.
TBR=nkostylev@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174792 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Remove refcounted_profile_keyed_service.h include from c/b/api.

This was a TODO for joi@.

BUG=138280
TBR=joi@chromium.org


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174794 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add bad url unit test to prerendering.

This very simple unit test just makes sure that we totally the right thing when starting an invalid URL prerender. The logic in AddPrerender confused me, but I'm now convinced (again) that it's correct. I also add a DCHECK in prerender manager, to save future generations this angst.

R=mmenke@chromium.org
BUG=None


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174805 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Refactor first_run, very few things should depend on whether the First Run sentinel itself was present... (i.e. most tasks should not be on if flags such as --no-first-run are present).

This is a prerequisite for issue 165048 as we want to be able to launch Chrome with --no-first-run and have two guarantees:
1) No first run tasks happen
2) First Run sentinel is set so that first run never happens for this new Chrome.

This also removes PreInteractiveFirstRunInit() and PostInteractiveFirstRunInit() from BrowserMainParts as I just realized AutoImport is now silent and it is thus no longer necessary to split this in two :)! Moved everything to first_run::PostImportTasks().

This CL also buffs --first-run to --force-first-run (to be more explicit); --first-run now overrides --no-first-run as far as first run tasks are concerned (i.e. as far as everything first run related is concerned; except code that specifically looks for --no-first-run on the command line) -- kNoFirstRun used to state it would override kFirstRun, but that wasn't true anyways ans it makes more sense/is more useful the other way around.

Now a browser test may specify --force-first-run and get the full first run experience even if the underlying test harness specifies --no-first-run for all tests :).

--no-first-run is otherwise unaffected (i.e. same behavior as before) if --force-first-run is not present

BUG=165048
TEST=
1) Run chrome.exe --force-first-run from build output and see First Run flow although First Run beacon is  present.
2) Delete "First Run" beacon and ensure that chrome.exe --no-first-run both skips the first run and creates the beacon.
3) Ensure that chrome.exe --force-first-run --no-first-run acts the same as chrome.exe --force-first-run.

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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174809 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Do not recursively delete prerenders from within deleting prerenders.

If a prerender is destroyed, and that reveals another runnable prerender, then we end up calling PrerenderManager::AddPrerender(), which calls to_delete_prerenders_.clear(), which deletes the prerender contents, setting the stage for problems when we continue executing PrerenderContents::Destroy().

There's two ways to fix this, but only one that works; my first thought was to make the stop notification the last thing in Destroy, but that's no good, since there could be multiple observers (and there's usually two, could be three or more...), and so we're safer that way, but it's not perfect.

The better option is to just rely on periodic cleanups to clear the pending delete list. The list was cleared in the old PrerenderManager::AddPrerender code because we used to do eviction there, so it was important to be clean. But that's less important now.

R=mmenke@chromium.org
BUG=167877


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174813 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Raze the database if the favicon table has an invalid structure

BUG=151841, 160360
Test=Manual, see below
  1) Run chrome with the --user-data-dir= flag
  2) Bookmark a couple pages
  3) Open up the Favicons database using the "SQLite manager " add-on for Firefox (The Favicons database should be in the directory specified by --user-data-dir)
  4) Delete the 'icon_type' column in the favicons table.
  5) Run Chrome again and the bookmarks should be missing their favicons. However, upon clicking on the bookmarks, the favicons should come back.
  6) Close Chrome and restart. The bookmarks whose favicons reappeared should still have their favicons.

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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174819 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Break cyclic dependency between c/b/chromeos and c/b/chromeos/input_method...

...by extracting input_method_constants from language_preferences.

TBR=zelidrag,jochen
BUG=164375


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174829 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add some field trials to the DNS probing code

BUG=156415


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174834 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Prevent Getting Started screen from appearing for Public Accounts

This CL changes the default startup behavior for Public Accounts so that
instead of the Getting Started screen, a browser showing the NTP is opened.
This default can be overridden by the Public Account's policy.

BUG=166428
TEST=Manual


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174837 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Fix memory leak in prerender unittests

Kind of amazing: the final status on this wasn't being checked, and it was leaking. Now it's checked, and it isn't leaking. This is probably a flaw in the unit test infrastructure.

BUG=167866
R=mmenke@chromium.org


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174838 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Missing Alt+Search in keyboard overlay.

Fix the shortcut string after crrev.com/170596.

BUG=167554
TEST=local


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174839 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Close bubble when bookmark star button is clicked a second time

Currently when the bookmark star button is clicked a second time it closes and shows again.

The bookmark bubble already has logic to check if the bubble is showing and do nothing if asked to show again.

Unfortunately this doesn't work for mouse events because the bubble is closed on mouse down and shown on mouse up.

To fix this I'm adding a flag to check if the bubble was visible on mouse down. If the flag is set then the mouse up event is ignored.

BUG=107876
TEST=Clicked on the bookmark button a second time. Verified that the bubble didn't reopn.
Added a new browser test. Verified that the test failed without my change and passed with it.


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174846 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This refactor aims to avoid use of CR_DEFINE_STATIC_LOCAL and functions returning references. The offending pieces of code were using URLRequestFilter. As of r174174 we can avoid CR_DEFINE_STATIC_LOCAL by wrapping the data in a ProtocolHandler class. While making this change I also changed URLRequestFilter::AddHostnameProtocolHandler() to take ownership of the ProtocolHandler and I added URLRequestFilter::AddUrlProtocolHandler(). 

BUG=163410

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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174859 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Rename IPC handlers that are in the form of OnMsgFoo to OnFoo. This is how almost all the handlers are called.
Review URL: https://codereview.chromium.org/11695005

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174868 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
chromeos: Support signals being moved from powerm to powerd.

This updates PowerManagerClient to handle power button, lid
open/close, and resume signals that are currently sent by
powerm but will soon be sent by powerd.  The powerm and
powerd versions are supported at present, but it'll soon be
possible to remove RootPowerManagerClient.

BUG=chromium-os:36804


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174869 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Adds DisplayPreferencesTest for chromeos


BUG=163812, 166964
TEST=unit_test --gtest_filter='DisplayPreferencesTest.*' passes

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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174876 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Change ExecuteJavaScript* helper functions in browser_test_utils.{h,cc}
to take std::string (UTF-8) instead of std::wstring.  This seems to help
simplify callsites considerably.

TBR=jam@chromium.org
BUG=none


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174880 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
chromeos: Update focus ring color in WebKit.

This sets WebKit's focus ring color to #4d90fe;
USE_DEFAULT_RENDER_THEME-defining builds like Chrome OS
appear to have been previously using the default of #e59700
from RenderThemeChromiumSkia.

It also makes RenderViewImpl honor the caret blink interval
for USE_DEFAULT_RENDER_THEME instead of just for GTK.

BUG=153080
TEST=manual: focus rings are blue instead of orange


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174881 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Failing to CopyPrefFile() shouldn't prevent processing of other preferences.


BUG=This was likely not a known issue, but if we somehow failed to copy the file we would stop processing preferences early (i.e. skip default browser, import, etc.); although it's not related...


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

git-svn-id: http://src.chromium.org/svn/trunk/src/chrome/browser@174889 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Remove vestigial ScopedAllowIO from SQLitePersistentCookieStore.

BUG=none


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

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